Avnu / OpenAvnu

OpenAvnu - an Avnu sponsored repository for Time Sensitive Network (TSN and AVB) technology
462 stars 289 forks source link

Fixed build issues in Linux #906

Open johandroid opened 3 years ago

johandroid commented 3 years ago

This fix the build in an ubuntu environment.

You can use a Docker container to build with the following Dockerfile:

##########################################################

Suggested build:

sudo docker build -t avb-builder:1.0 .

Suggested run example:

sudo docker run -dit --name $UserName-Project-AVB -v ~/Documents/TE/Projects/AVB/OpenAvnu/:/code avb-builder:1.0

FROM ubuntu:20.04 MAINTAINER Lex Duque johan.duque@gmail.com

ARG USERID="1000" ARG GROUPID="1000" ARG TheGroup="thegroup" ARG TheUser="theuser" ARG TheWorkDir="/code" ARG ThePass="thepass"

Users and groups

ENV USERID "${USERID}" ENV GROUPID "${GROUPID}" ENV TEGroup "${TEGroup}" ENV TEUser "${TEUser}" ENV TEWorkDir "${TEWorkDir}" ENV TEPass "${TEPass}"

ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Europe/Barcelona RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN rm -rf /var/lib/apt/lists/* RUN apt update -y && apt -y full-upgrade RUN apt install -y libpci-dev libpcap-dev libsndfile-dev libjack-dev make gcc cmake g++ libasound2-dev libglib2.0-dev

RUN rm /bin/sh && ln -s bash /bin/sh

User definition

RUN groupadd -g ${GROUPID} ${TheGroup} RUN useradd -u ${USERID} -g ${GROUPID} -ms /bin/bash ${TheUser} RUN usermod -a -G sudo ${TheUser} RUN usermod -a -G users ${TheUser} RUN echo "${TheUser}:${ThePass}" | chpasswd

Set Environment vars

ENV host=dockerbuilder WORKDIR /${TheWorkDir} RUN install -o ${USERID} -g ${GROUPID} -d ${TheWorkDir} WORKDIR ${TheWorkDir}

##################################

It's up to you to include this Dockerfile in the repository.