nrf-connect-sdk-ci/Dockerfile

90 lines
2.7 KiB
Docker
Raw Normal View History

2023-09-16 23:25:10 +03:00
FROM debian:stable-slim
#ARG ARCH=amd64
2024-12-20 11:17:54 +03:00
ARG NRF_CONNECT_TAG=v2.9.0
2023-09-17 22:10:16 +03:00
# Should be for selected NRF_CONNECT_TAG
2024-12-20 11:12:26 +03:00
ARG ZEPHYR_NEEDED_TAG=0.16.8
2023-09-16 23:25:10 +03:00
# For new versions - xz
2023-09-22 00:08:11 +03:00
ARG ZEPHYR_ARCHIVE_EXTENSION=xz
2023-09-17 22:10:16 +03:00
# For entrypoint file
ENV ZEPHYR_TAG=$ZEPHYR_NEEDED_TAG
2023-09-16 23:25:10 +03:00
RUN ARCH="$(dpkg --print-architecture)" && \
case $ARCH in \
"amd64") \
ZEPHYR_ARCH="x86_64" \
;; \
"arm64") \
ZEPHYR_ARCH="aarch64" \
;; \
2023-09-21 23:46:28 +03:00
# Get nessecary packages
2023-09-16 23:25:10 +03:00
esac && \
apt-get update && \
apt-get install \
--no-install-recommends \
git \
cmake \
ninja-build \
gperf \
ccache \
dfu-util \
device-tree-compiler \
wget \
python3-dev \
python3-pip \
python3-setuptools \
python3-tk \
python3-wheel \
xz-utils \
file \
make \
gcc \
libsdl2-dev \
libmagic1 \
unzip \
build-essential \
libgit2-dev \
-y && \
2023-09-21 23:46:28 +03:00
# Remove apt cache
2023-09-16 23:25:10 +03:00
rm -rf /var/cache/apt && \
pip3 install --upgrade pip --break-system-packages && \
2023-09-21 23:43:20 +03:00
# Create work directory
2023-09-21 23:25:25 +03:00
mkdir /workdir && \
2023-09-21 23:43:20 +03:00
# Get GN tools for matter
2023-09-21 23:25:25 +03:00
cd /usr/bin && \
2023-09-16 23:25:10 +03:00
wget -O gn.zip https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-$ARCH/+/latest &&\
unzip gn.zip && \
rm gn.zip && \
2023-09-21 23:43:20 +03:00
# Install west
2023-09-16 23:25:10 +03:00
pip3 install west --break-system-packages && \
2023-09-21 23:25:25 +03:00
cd /workdir && \
mkdir ncs && \
cd ncs && \
2023-09-21 23:43:20 +03:00
# Get NRF SDK code
2023-09-16 23:25:10 +03:00
west init -m https://github.com/nrfconnect/sdk-nrf --mr $NRF_CONNECT_TAG && \
west update && \
west zephyr-export && \
pip3 install -r zephyr/scripts/requirements.txt --break-system-packages && \
pip3 install -r nrf/scripts/requirements.txt --break-system-packages && \
pip3 install -r bootloader/mcuboot/scripts/requirements.txt --break-system-packages && \
2023-09-21 23:25:25 +03:00
cd /workdir && \
2023-09-21 23:43:20 +03:00
# Get toolchain (minimal)
2023-09-21 09:01:11 +03:00
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_TAG}/zephyr-sdk-${ZEPHYR_TAG}_linux-${ZEPHYR_ARCH}_minimal.tar.${ZEPHYR_ARCHIVE_EXTENSION} && \
2023-09-16 23:25:10 +03:00
(wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_TAG}/sha256.sum | shasum --check --ignore-missing) && \
2023-09-21 09:01:11 +03:00
tar xvf zephyr-sdk-${ZEPHYR_TAG}_linux-${ZEPHYR_ARCH}_minimal.tar.${ZEPHYR_ARCHIVE_EXTENSION} && \
rm zephyr-sdk-${ZEPHYR_TAG}_linux-${ZEPHYR_ARCH}_minimal.tar.${ZEPHYR_ARCHIVE_EXTENSION} && \
2023-09-21 23:43:20 +03:00
# Remove unused packages
2023-09-16 23:25:10 +03:00
apt-get remove python3-pip build-essential -y && \
apt autoremove -y && \
2023-09-17 21:17:19 +03:00
apt autoclean -y && \
2023-09-21 23:43:20 +03:00
# Install arm-zephyr-eabi toolchain for NRF
2023-09-21 09:01:11 +03:00
./zephyr-sdk-${ZEPHYR_TAG}/setup.sh -t arm-zephyr-eabi && \
./zephyr-sdk-${ZEPHYR_TAG}/setup.sh -c
2023-09-16 23:25:10 +03:00
2023-09-21 23:25:25 +03:00
ADD entrypoint.sh /entrypoint.sh
2023-09-16 23:25:10 +03:00
2023-09-21 23:25:25 +03:00
RUN chmod +x /entrypoint.sh
2023-09-16 23:25:10 +03:00
2023-09-21 23:25:25 +03:00
ENTRYPOINT [ "/entrypoint.sh" ]