|
1 | 1 | ARG VERSION=1 |
2 | 2 |
|
3 | | -# ================================================== |
4 | | -# Temporary image for SDK and dependencies download |
5 | | -# ================================================== |
6 | | - |
7 | 3 | FROM ghcr.io/project-chip/chip-build:${VERSION} as build |
8 | | -LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip |
9 | | -# Compatible Nordic Connect SDK revision. |
10 | | -ARG NCS_REVISION=v2.9.0 |
11 | 4 |
|
12 | | -# Requirements to clone SDKs in temporary container |
| 5 | +# Compatible Nordic Connect SDK revision and required tools versions |
| 6 | +ARG NCS_REVISION=v3.0.0 |
| 7 | +ARG JLINK_VERSION="JLink_Linux_V818_x86_64" |
| 8 | +ARG WEST_VERSION=1.2.0 |
| 9 | +ARG CMAKE_VERSION=3.25.0 |
| 10 | + |
| 11 | +# Requirements to clone SDKs |
13 | 12 | RUN set -x \ |
14 | 13 | && apt-get update \ |
15 | 14 | && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ |
16 | 15 | xz-utils \ |
| 16 | + && apt-get clean \ |
| 17 | + && rm -rf /var/lib/apt/lists/ \ |
17 | 18 | && : # last line |
18 | 19 |
|
19 | 20 | SHELL ["/bin/bash", "-o", "pipefail", "-c"] |
20 | 21 | WORKDIR /opt/NordicSemiconductor/nRF5_tools |
21 | 22 | RUN set -x \ |
22 | | - && curl --location https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-24-2/nrf-command-line-tools-10.24.2_linux-amd64.tar.gz \ |
23 | | - | tar zxvf - \ |
24 | | - && tar xvf JLink_Linux_V794e_x86_64.tgz \ |
25 | | - && rm JLink_Linux_V794e_x86_64.* \ |
26 | | - && curl --location https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz --output zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz \ |
27 | | - && tar xvf zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz \ |
28 | | - && rm -rf zephyr-sdk-0.17.0_linux-x86_64_minimal.tar.xz \ |
29 | | - && zephyr-sdk-0.17.0/setup.sh -t arm-zephyr-eabi \ |
| 23 | + # Get JLink |
| 24 | + && curl -d "accept_license_agreement=accepted&submit=Download+software" -X POST -O "https://www.segger.com/downloads/jlink/${JLINK_VERSION}.tgz" \ |
| 25 | + && tar xvf ${JLINK_VERSION}.tgz \ |
| 26 | + && rm ${JLINK_VERSION}.* \ |
| 27 | + # Get nRF Util |
| 28 | + && curl --location https://files.nordicsemi.com/artifactory/swtools/external/nrfutil/executables/x86_64-unknown-linux-gnu/nrfutil -o nrfutil \ |
| 29 | + && chmod +x ./nrfutil \ |
| 30 | + && ./nrfutil self-upgrade \ |
| 31 | + && ./nrfutil install device \ |
| 32 | + && ./nrfutil install sdk-manager \ |
| 33 | + # Download nRF Connect toolchain |
| 34 | + && ./nrfutil sdk-manager toolchain install --ncs-version "$NCS_REVISION" --install-dir ./zephyr-sdk \ |
30 | 35 | && : # last line |
31 | 36 |
|
32 | 37 | WORKDIR /opt/NordicSemiconductor/nrfconnect |
33 | 38 | RUN set -x \ |
34 | | - && python3 -m pip install --break-system-packages -U --no-cache-dir west==1.2.0 \ |
| 39 | + && python3 -m pip install --break-system-packages -U --no-cache-dir west==${WEST_VERSION} \ |
35 | 40 | && west init -m https://github.com/nrfconnect/sdk-nrf --mr "$NCS_REVISION" \ |
36 | 41 | && west config update.narrow true \ |
37 | 42 | && west config update.fetch smart \ |
38 | 43 | && west update -o=--depth=1 -n -f smart \ |
39 | 44 | && : # last line |
40 | 45 |
|
41 | | -# ================================================== |
42 | | -# nRF Connect SDK final image |
43 | | -# ================================================== |
44 | | - |
45 | | -FROM ghcr.io/project-chip/chip-build:${VERSION} |
46 | | - |
47 | 46 | # Tools for building, flashing and accessing device logs |
48 | 47 | RUN set -x \ |
49 | 48 | && apt-get update \ |
50 | | - && apt-get install --no-install-recommends -fy device-tree-compiler gcc-multilib g++-multilib \ |
| 49 | + && apt-get install --no-install-recommends -fy device-tree-compiler gcc-multilib g++-multilib libusb-1.0-0 \ |
51 | 50 | && apt-get clean \ |
52 | 51 | && rm -rf /var/lib/apt/lists/ \ |
53 | 52 | && : # last line |
54 | 53 |
|
55 | | -COPY --from=build /opt/NordicSemiconductor/nRF5_tools/ /opt/NordicSemiconductor/nRF5_tools/ |
56 | | -COPY --from=build /opt/NordicSemiconductor/nrfconnect/ /opt/NordicSemiconductor/nrfconnect/ |
57 | | - |
58 | | -RUN set -x \ |
59 | | - # python3-yaml and python3-numpy packages conflict with nRF Python requirements |
60 | | - && (apt-get remove -fy python3-yaml python3-numpy && apt-get autoremove || exit 0) \ |
61 | | - && python3 -m pip install --break-system-packages -U --no-cache-dir cmake==3.25.0 \ |
62 | | - && python3 -m pip install --break-system-packages --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/zephyr/scripts/requirements-base.txt \ |
63 | | - && python3 -m pip install --break-system-packages --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/nrf/scripts/requirements-build.txt \ |
64 | | - && python3 -m pip install --break-system-packages --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/bootloader/mcuboot/scripts/requirements.txt \ |
65 | | - && python3 -m pip install --break-system-packages --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/modules/lib/matter/scripts/setup/requirements.nrfconnect.txt \ |
66 | | - && : # last line |
67 | | - |
68 | 54 | ENV NRF5_TOOLS_ROOT=/opt/NordicSemiconductor/nRF5_tools |
69 | | -ENV PATH=${NRF5_TOOLS_ROOT}/JLink_Linux_V794e_x86_64:${PATH} |
70 | | -ENV PATH=${NRF5_TOOLS_ROOT}/nrf-command-line-tools/bin:${PATH} |
71 | | -ENV LD_LIBRARY_PATH=${NRF5_TOOLS_ROOT}/JLink_Linux_V794e_x86_64:${LD_LIBRARY_PATH} |
| 55 | +ENV PATH=${NRF5_TOOLS_ROOT}:$PATH |
| 56 | +ENV PATH=${NRF5_TOOLS_ROOT}/${JLINK_VERSION}:${PATH} |
72 | 57 | ENV LC_ALL=C.UTF-8 |
73 | 58 | ENV LANG=C.UTF-8 |
74 | 59 | ENV ZEPHYR_BASE=/opt/NordicSemiconductor/nrfconnect/zephyr |
75 | | -ENV ZEPHYR_SDK_INSTALL_DIR=${NRF5_TOOLS_ROOT}/zephyr-sdk-0.17.0 |
76 | | -ENV ZEPHYR_TOOLCHAIN_VARIANT=zephyr |
77 | | -ENV ZEPHYR_TOOLCHAIN_PATH=${ZEPHYR_SDK_INSTALL_DIR}/arm-zephyr-eabi |
| 60 | + |
| 61 | +# Set up Zephyr SDK environment variables |
| 62 | +RUN set -x \ |
| 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 \ |
| 66 | + # Remove redundant directory created by nrfutil |
| 67 | + && rm -rf ${NRF5_TOOLS_ROOT}/zephyr-sdk/downloads \ |
| 68 | + && : # last line |
0 commit comments