|
1 | 1 | ARG VERSION=1 |
2 | 2 |
|
3 | | -FROM ghcr.io/project-chip/chip-build:${VERSION} as build |
| 3 | +FROM ghcr.io/project-chip/chip-build:${VERSION} AS build |
4 | 4 |
|
5 | 5 | # Compatible Nordic Connect SDK revision and required tools versions |
6 | 6 | ARG NCS_REVISION=v3.0.0 |
@@ -61,8 +61,25 @@ ENV ZEPHYR_BASE=/opt/NordicSemiconductor/nrfconnect/zephyr |
61 | 61 | # Set up Zephyr SDK environment variables |
62 | 62 | RUN set -x \ |
63 | 63 | # Setup Zephyr SDK environment variables |
64 | | - # Do not use the nrfconnect python environment because the python environment should be created by bootstrap.sh |
65 | | - && nrfutil sdk-manager toolchain env --as-script --ncs-version "$NCS_REVISION" --install-dir ${NRF5_TOOLS_ROOT}/zephyr-sdk | grep -v "PYTHONHOME\|PYTHONPATH" | tee -a /root/.bashrc \ |
| 64 | + && nrfutil sdk-manager toolchain env --as-script --ncs-version "$NCS_REVISION" --install-dir ${NRF5_TOOLS_ROOT}/zephyr-sdk > $ZEPHYR_BASE/zephyr-env.sh \ |
| 65 | + && echo "source $ZEPHYR_BASE/zephyr-env.sh" >> /etc/bash.bashrc \ |
| 66 | + # Create a symlink named "latest" pointing to the toolchain directory to avoid hash in the path |
| 67 | + && source $ZEPHYR_BASE/zephyr-env.sh \ |
| 68 | + && ln -s ${ZEPHYR_SDK_INSTALL_DIR} ${NRF5_TOOLS_ROOT}/zephyr-sdk/toolchains/latest \ |
66 | 69 | # Remove redundant directory created by nrfutil |
67 | 70 | && rm -rf ${NRF5_TOOLS_ROOT}/zephyr-sdk/downloads \ |
68 | 71 | && : # last line |
| 72 | + |
| 73 | +# Install Zephyr and nRF Connect SDK requirements |
| 74 | +RUN set -x \ |
| 75 | + && source $ZEPHYR_BASE/zephyr-env.sh \ |
| 76 | + && python3 -m pip install -v --no-build-isolation --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/zephyr/scripts/requirements-base.txt \ |
| 77 | + && python3 -m pip install -v --no-build-isolation --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/nrf/scripts/requirements-build.txt \ |
| 78 | + && python3 -m pip install -v --no-build-isolation --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/bootloader/mcuboot/scripts/requirements.txt \ |
| 79 | + && python3 -m pip install -v --no-build-isolation --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/modules/lib/matter/scripts/setup/requirements.nrfconnect.txt \ |
| 80 | + # Remove protobuf to avoid version conflict |
| 81 | + && python3 -m pip uninstall -y protobuf \ |
| 82 | + && : # last line |
| 83 | + |
| 84 | +ENV ZEPHYR_TOOLCHAIN_VARIANT=zephyr |
| 85 | +ENV ZEPHYR_SDK_INSTALL_DIR=${NRF5_TOOLS_ROOT}/zephyr-sdk/toolchains/latest/opt/zephyr-sdk |
0 commit comments