2023-07-21 10:49:11 +02:00
|
|
|
FROM debian:bookworm-slim AS common
|
2020-12-03 11:34:06 +01:00
|
|
|
|
|
|
|
CMD ["/bin/bash"]
|
|
|
|
|
2020-12-03 05:57:49 +01:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2020-12-03 11:34:06 +01:00
|
|
|
ARG ZEPHYR_VERSION
|
|
|
|
ENV ZEPHYR_VERSION=${ZEPHYR_VERSION}
|
|
|
|
RUN \
|
|
|
|
apt-get -y update \
|
2022-01-27 20:51:19 +01:00
|
|
|
&& if [ "$(uname -m)" = "x86_64" ]; then gcc_multilib="gcc-multilib"; else gcc_multilib=""; fi \
|
2020-12-03 11:34:06 +01:00
|
|
|
&& apt-get -y install --no-install-recommends \
|
|
|
|
ccache \
|
|
|
|
file \
|
|
|
|
gcc \
|
2022-01-27 20:51:19 +01:00
|
|
|
"${gcc_multilib}" \
|
2020-12-03 11:34:06 +01:00
|
|
|
git \
|
|
|
|
gperf \
|
|
|
|
make \
|
|
|
|
ninja-build \
|
|
|
|
python3 \
|
2021-06-14 13:03:46 +02:00
|
|
|
python3-dev \
|
2020-12-03 11:34:06 +01:00
|
|
|
python3-pip \
|
|
|
|
python3-setuptools \
|
|
|
|
python3-wheel \
|
2023-06-05 19:31:54 +02:00
|
|
|
ssh \
|
2023-07-21 15:33:53 +02:00
|
|
|
&& pip3 install --break-system-packages \
|
2020-12-03 11:34:06 +01:00
|
|
|
-r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/v${ZEPHYR_VERSION}/scripts/requirements-base.txt \
|
2023-07-21 15:33:53 +02:00
|
|
|
&& pip3 install --break-system-packages cmake \
|
2020-12-03 11:34:06 +01:00
|
|
|
&& apt-get remove -y --purge \
|
2021-06-14 13:03:46 +02:00
|
|
|
python3-dev \
|
2020-12-03 11:34:06 +01:00
|
|
|
python3-pip \
|
|
|
|
python3-setuptools \
|
|
|
|
python3-wheel \
|
|
|
|
&& apt-get clean \
|
2021-06-10 21:23:56 +02:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2020-12-03 11:34:06 +01:00
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
FROM common AS dev-generic
|
|
|
|
|
2020-12-02 22:32:59 +01:00
|
|
|
ENV LC_ALL=C
|
2021-05-19 19:59:18 +02:00
|
|
|
ENV PAGER=less
|
2020-12-02 22:32:59 +01:00
|
|
|
|
2020-12-03 11:34:06 +01:00
|
|
|
RUN \
|
|
|
|
apt-get -y update \
|
2021-06-15 20:27:48 +02:00
|
|
|
&& apt-get -y install --no-install-recommends \
|
2020-12-02 14:04:53 +01:00
|
|
|
curl \
|
2022-10-26 05:14:35 +02:00
|
|
|
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - \
|
2020-12-02 14:04:53 +01:00
|
|
|
&& apt-get -y update \
|
|
|
|
&& apt-get -y install --no-install-recommends \
|
2020-12-07 16:03:31 +01:00
|
|
|
clang-format \
|
2021-05-18 12:28:16 +02:00
|
|
|
gdb \
|
2020-11-26 15:21:58 +01:00
|
|
|
gpg \
|
2020-12-02 14:04:53 +01:00
|
|
|
gpg-agent \
|
2021-05-18 12:28:07 +02:00
|
|
|
less \
|
2021-10-26 06:31:16 +02:00
|
|
|
libpython3.8-dev \
|
2020-12-03 11:34:06 +01:00
|
|
|
libsdl2-dev \
|
2020-12-02 22:32:59 +01:00
|
|
|
locales \
|
2020-11-26 21:07:02 +01:00
|
|
|
nano \
|
2020-12-02 14:04:53 +01:00
|
|
|
nodejs \
|
2020-12-03 11:34:06 +01:00
|
|
|
python3 \
|
|
|
|
python3-dev \
|
|
|
|
python3-pip \
|
|
|
|
python3-setuptools \
|
|
|
|
python3-tk \
|
|
|
|
python3-wheel \
|
2021-05-20 23:05:24 +02:00
|
|
|
socat \
|
2021-06-15 18:27:14 +02:00
|
|
|
tio \
|
2020-12-03 11:34:06 +01:00
|
|
|
wget \
|
|
|
|
xz-utils \
|
2023-07-21 15:33:53 +02:00
|
|
|
&& pip3 install --break-system-packages \
|
2020-12-03 11:34:06 +01:00
|
|
|
-r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/v${ZEPHYR_VERSION}/scripts/requirements-build-test.txt \
|
|
|
|
-r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/v${ZEPHYR_VERSION}/scripts/requirements-run-test.txt \
|
|
|
|
&& apt-get clean \
|
2021-06-10 21:22:53 +02:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2020-12-03 11:34:06 +01:00
|
|
|
|
2021-06-15 16:40:24 +02:00
|
|
|
ARG ZEPHYR_SDK_VERSION
|
|
|
|
ENV ZEPHYR_SDK_VERSION=${ZEPHYR_SDK_VERSION}
|
|
|
|
|
2020-12-03 05:57:49 +01:00
|
|
|
ENV DEBIAN_FRONTEND=
|
|
|
|
|
2020-12-03 11:34:06 +01:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
FROM common AS build
|
|
|
|
|
|
|
|
ARG ARCHITECTURE
|
|
|
|
ARG ZEPHYR_SDK_VERSION
|
|
|
|
ARG ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk-${ZEPHYR_SDK_VERSION}
|
|
|
|
RUN \
|
2022-10-08 07:56:49 +02:00
|
|
|
export minimal_sdk_file_name="zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-$(uname -m)_minimal" \
|
|
|
|
&& if [ "${ARCHITECTURE}" = "arm" ]; then arch_format="eabi"; else arch_format="elf"; fi \
|
|
|
|
&& if [ "${ARCHITECTURE#xtensa}" = "${ARCHITECTURE}" ]; then arch_sep="-"; else arch_sep="_"; fi \
|
2022-01-27 20:51:19 +01:00
|
|
|
&& apt-get -y update \
|
2020-12-03 11:34:06 +01:00
|
|
|
&& apt-get -y install --no-install-recommends \
|
|
|
|
wget \
|
|
|
|
xz-utils \
|
2022-10-08 07:56:49 +02:00
|
|
|
&& cd ${TMP} \
|
|
|
|
&& wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/${minimal_sdk_file_name}.tar.gz" \
|
|
|
|
&& tar xvfz ${minimal_sdk_file_name}.tar.gz \
|
|
|
|
&& mv zephyr-sdk-${ZEPHYR_SDK_VERSION} /opt/ \
|
|
|
|
&& rm ${minimal_sdk_file_name}.tar.gz \
|
|
|
|
&& cd /opt/zephyr-sdk-${ZEPHYR_SDK_VERSION} \
|
|
|
|
&& ./setup.sh -h -c -t ${ARCHITECTURE}${arch_sep}zephyr-${arch_format} \
|
|
|
|
&& cd \
|
2020-12-03 11:34:06 +01:00
|
|
|
&& apt-get remove -y --purge \
|
|
|
|
wget \
|
|
|
|
xz-utils \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
FROM dev-generic AS dev
|
|
|
|
|
2021-10-26 06:32:18 +02:00
|
|
|
COPY --from=build ${ZEPHYR_SDK_INSTALL_DIR} ${ZEPHYR_SDK_INSTALL_DIR}
|