2020-12-17 13:12:06 +00:00
|
|
|
FROM ubuntu:18.04
|
|
|
|
|
2020-12-18 17:58:34 +00:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update -qq \
|
|
|
|
&& apt-get install -y \
|
2020-12-17 13:12:06 +00:00
|
|
|
# x86_64 / generic packages
|
2020-12-18 17:58:34 +00:00
|
|
|
bash \
|
|
|
|
build-essential \
|
|
|
|
cmake \
|
|
|
|
git \
|
|
|
|
make \
|
|
|
|
python3 \
|
|
|
|
python3-pip \
|
|
|
|
tar \
|
|
|
|
unzip \
|
|
|
|
wget \
|
2020-12-17 13:12:06 +00:00
|
|
|
# aarch64 packages
|
2020-12-18 17:58:34 +00:00
|
|
|
libffi-dev \
|
|
|
|
libssl-dev \
|
|
|
|
python3-dev \
|
|
|
|
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/*;
|
2020-12-17 13:12:06 +00:00
|
|
|
|
|
|
|
RUN pip3 install adafruit-nrfutil
|
2021-02-14 13:19:30 +00:00
|
|
|
RUN pip3 install -Iv cryptography==3.3
|
2020-12-17 13:12:06 +00:00
|
|
|
|
|
|
|
# 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;"
|
|
|
|
|
2020-12-18 17:58:34 +00:00
|
|
|
ARG PUID=1000
|
|
|
|
ARG PGID=1000
|
|
|
|
RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime
|
2020-12-17 13:12:06 +00:00
|
|
|
|
2020-12-18 17:58:34 +00:00
|
|
|
USER infinitime:infinitime
|
2020-12-17 13:12:06 +00:00
|
|
|
ENV SOURCES_DIR /sources
|
|
|
|
CMD ["/opt/build.sh"]
|