|
2 | 2 | # Copyright(c) 2025 Intel Corporation. All rights reserved. |
3 | 3 |
|
4 | 4 | # 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 |
6 | 6 |
|
7 | 7 | # Remove additional toolchains. |
8 | 8 | # 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* \ |
12 | 14 | micro* \ |
13 | 15 | mips* \ |
14 | 16 | nios* \ |
15 | 17 | risc* \ |
16 | 18 | sparc* \ |
| 19 | + sysroots \ |
17 | 20 | x86* \ |
18 | 21 | xtensa-espressif* \ |
19 | 22 | xtensa-sample* \ |
20 | 23 | xtensa-dc233c* |
21 | 24 |
|
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 | | - |
35 | 25 | # Use ubuntu24.04 as base for zephyr-lite |
36 | 26 | FROM ubuntu:24.04 as zephyr-lite |
37 | 27 |
|
38 | 28 | # Copy needed files from base to zephyr-lite |
39 | 29 | # /opt for toolchains and sdk |
40 | 30 | # /usr for binaries and libs |
41 | 31 | # /home for libs installed in .local |
| 32 | +# /etc/ssl for ssl certs for python packages |
42 | 33 | COPY --from=base /opt /opt |
43 | 34 | COPY --from=base /usr /usr |
44 | 35 | COPY --from=base /home /home |
| 36 | +COPY --from=base /etc/ssl /etc/ssl |
45 | 37 |
|
46 | 38 | USER root |
47 | 39 |
|
48 | 40 | # Create a user if it doesn't already exist and grant them permission to /home/user. |
49 | 41 | # Add user to dialout and sudo group |
50 | 42 | RUN useradd -ms /bin/bash user && \ |
51 | 43 | chown -R user:user /home/user && \ |
| 44 | + chown -R user:user /opt/python && \ |
52 | 45 | usermod -a -G dialout,sudo user |
53 | 46 |
|
54 | 47 | USER user |
55 | 48 |
|
| 49 | +# Install cmake and jsonschema in venv |
| 50 | +RUN /opt/python/venv/bin/pip install 'cmake>=3.21' jsonschema |
| 51 | + |
56 | 52 | # 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 |
58 | 55 | ENV ZEPHYR_TOOLCHAIN_VARIANT=zephyr |
| 56 | + |
| 57 | +CMD ["/bin/bash", "-l"] |
0 commit comments