From a7df0a02799442ab38e1b365d4363cca6d93f029 Mon Sep 17 00:00:00 2001 From: Joe Eaves Date: Thu, 17 Dec 2020 13:12:06 +0000 Subject: Unify the Dockerfiles by fleshing out build.sh Script is written to handle it's own dependencies so it can be used within Docker or on the host system --- docker/Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docker/Dockerfile (limited to 'docker/Dockerfile') diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..8f56356c --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,37 @@ +FROM ubuntu:18.04 + +RUN \ + apt-get update -qq && \ + apt-get install -y \ +# x86_64 / generic packages + bash git gosu \ + cmake make build-essential \ + wget unzip \ + python3 python3-pip \ +# aarch64 packages + libffi-dev libssl-dev python3-dev \ + && rm -rf /var/lib/apt/lists/*; + +RUN pip3 install adafruit-nrfutil + +# build.sh knows how to compile +COPY build.sh /opt/ + +# Lets get each in a separate docker layer for better downloads +# GCC +RUN bash -c "source /opt/build.sh; GetGcc;" +# NrfSdk +RUN bash -c "source /opt/build.sh; GetNrfSdk;" +# McuBoot +RUN bash -c "source /opt/build.sh; GetMcuBoot;" + +# Set and arg and use it in the env for power to override at build AND runtime +ARG USER_ID=33333 +ARG GROUP_ID=33333 +ENV USER_ID $USER_ID +ENV GROUP_ID $GROUP_ID + +ENV SOURCES_DIR /sources +COPY entrypoint.sh /opt/ +ENTRYPOINT ["/opt/entrypoint.sh"] +CMD ["/opt/build.sh"] -- cgit v1.2.3-70-g09d2