Skip to content

Commit 37ac744

Browse files
redzynixkv2019i
authored andcommitted
zephyr-lite: update base to zephyr-build v0.28.4
Update base to zephyr-build v0.28.4 and: - Remove python3.12 installation as it's already supplied by new docker base - Remove sysroots from toolchains to free up space - Install jsonschema, cmake - Update SDK to 0.17.4 - Use python venv for packages Signed-off-by: Mateusz Redzynia <mateuszx.redzynia@intel.com>
1 parent ab8ffc5 commit 37ac744

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

scripts/docker_build/zephyr_lite/Dockerfile

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,56 @@
22
# Copyright(c) 2025 Intel Corporation. All rights reserved.
33

44
# Use zephyr-build as base image
5-
FROM ghcr.io/zephyrproject-rtos/zephyr-build:v0.27.4 as base
5+
FROM ghcr.io/zephyrproject-rtos/zephyr-build:v0.28.4 as base
66

77
# Remove additional toolchains.
88
# As this is not ideal solution there is a plan to build docker image without zephyr-build as the base
9-
# and install only needeed toolchains in the future.
10-
RUN cd /opt/toolchains/zephyr-sdk-0.17.0 && \
11-
sudo rm -rvf arc* \
9+
# and install only needed toolchains in the future.
10+
USER root
11+
12+
RUN cd /opt/toolchains/zephyr-sdk-0.17.4 && \
13+
rm -rvf arc* \
1214
micro* \
1315
mips* \
1416
nios* \
1517
risc* \
1618
sparc* \
19+
sysroots \
1720
x86* \
1821
xtensa-espressif* \
1922
xtensa-sample* \
2023
xtensa-dc233c*
2124

22-
# Some of tests require python 3.12 - instll it from source
23-
RUN cd /tmp && wget -q --show-progress --progress=bar:force:noscroll --no-check-certificate https://www.python.org/ftp/python/3.12.9/Python-3.12.9.tgz && \
24-
tar -xf Python-3.12.9.tgz && \
25-
cd Python-3.12.9 && \
26-
./configure && \
27-
sudo make -j$(nproc) && \
28-
sudo make install && \
29-
sudo rm -rf /tmp/Python-3*
30-
31-
# Reinstall python3.10 packages with python3.12
32-
RUN python3.10 -m pip freeze > /tmp/python3.10.pip.txt && \
33-
cat /tmp/python3.10.pip.txt | xargs -n 1 python3.12 -m pip install || true
34-
3525
# Use ubuntu24.04 as base for zephyr-lite
3626
FROM ubuntu:24.04 as zephyr-lite
3727

3828
# Copy needed files from base to zephyr-lite
3929
# /opt for toolchains and sdk
4030
# /usr for binaries and libs
4131
# /home for libs installed in .local
32+
# /etc/ssl for ssl certs for python packages
4233
COPY --from=base /opt /opt
4334
COPY --from=base /usr /usr
4435
COPY --from=base /home /home
36+
COPY --from=base /etc/ssl /etc/ssl
4537

4638
USER root
4739

4840
# Create a user if it doesn't already exist and grant them permission to /home/user.
4941
# Add user to dialout and sudo group
5042
RUN useradd -ms /bin/bash user && \
5143
chown -R user:user /home/user && \
44+
chown -R user:user /opt/python && \
5245
usermod -a -G dialout,sudo user
5346

5447
USER user
5548

49+
# Install cmake and jsonschema in venv
50+
RUN /opt/python/venv/bin/pip install 'cmake>=3.21' jsonschema
51+
5652
# Set zephyr env variables
57-
ENV ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-0.17.0
53+
ENV PATH="/opt/python/venv/bin/:$PATH"
54+
ENV ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-0.17.4
5855
ENV ZEPHYR_TOOLCHAIN_VARIANT=zephyr
56+
57+
CMD ["/bin/bash", "-l"]

0 commit comments

Comments
 (0)