Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve nRF Connect Docker image used by Build example - nRF Connect SDK workflow #10937

Merged
merged 2 commits into from
Nov 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 43 additions & 19 deletions integrations/docker/images/chip-build-nrf-platform/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,68 @@
ARG VERSION=latest
FROM connectedhomeip/chip-build:${VERSION}
FROM connectedhomeip/chip-build:${VERSION} as build

# Compatible Nordic Connect SDK revision.
ARG NCS_REVISION=ffcf07fe4586634a6793a48e5444a7196e7ebac6

RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends -fy \
curl=7.68.0-1ubuntu2.7 \
woody-apple marked this conversation as resolved.
Show resolved Hide resolved
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& : # last line

# ==================================================
# nRF Connect SDK dependencies
# ==================================================

# Tools for building, flashing and accessing device logs
WORKDIR /opt/NordicSemiconductor/nRF5_tools/install
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends -fy device-tree-compiler ccache \
&& mkdir -p /opt/NordicSemiconductor/nRF5_tools/ \
&& curl https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-12-1/nRFCommandLineTools10121Linuxamd64.tar.gz \
| tar zxvf - \
&& cd .. \
&& tar xvf install/JLink_Linux_V688a_x86_64.tgz \
&& tar xvf install/nRF-Command-Line-Tools_10_12_1.tar \
&& rm -rf ./install /var/lib/apt/lists/ \
&& tar xvf JLink_Linux_V688a_x86_64.tgz -C /opt/NordicSemiconductor/nRF5_tools/ \
&& tar xvf nRF-Command-Line-Tools_10_12_1.tar -C /opt/NordicSemiconductor/nRF5_tools/ \
&& : # last line

# ==================================================
# nRF Connect SDK
# ==================================================

WORKDIR /opt/NordicSemiconductor/nrfconnect
RUN set -x \
# python3-yaml package conflicts with nRF Python requirements
&& (apt remove -fy python3-yaml && apt autoremove || exit 0) \
&& python3 -m pip install -U --no-cache-dir pip setuptools wheel cmake west \
&& python3 -m pip install -U --no-cache-dir \
cmake==3.21.2 \
west==0.11.1 \
&& west init -m https://github.com/nrfconnect/sdk-nrf \
&& git -C nrf fetch origin "$NCS_REVISION" \
&& git -C nrf checkout FETCH_HEAD \
&& west config update.narrow true \
&& west config update.fetch smart \
&& west update -o=--depth=1 -n -f smart \
&& python3 -m pip install --no-cache-dir -r zephyr/scripts/requirements.txt \
&& python3 -m pip install --no-cache-dir -r nrf/scripts/requirements.txt \
&& python3 -m pip install --no-cache-dir -r bootloader/mcuboot/scripts/requirements.txt \
&& : # last line

FROM connectedhomeip/chip-build:${VERSION}

# Tools for building, flashing and accessing device logs
RUN set -x \
&& apt-get update \
&& apt-get install --no-install-recommends -fy \
device-tree-compiler=1.5.1-1 \
ccache=3.7.7-1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/ \
&& : # last line

COPY --from=build /opt/NordicSemiconductor/nRF5_tools/ /opt/NordicSemiconductor/nRF5_tools/
COPY --from=build /opt/NordicSemiconductor/nrfconnect/ /opt/NordicSemiconductor/nrfconnect/

# ==================================================
# nRF Connect SDK
# ==================================================

RUN set -x \
# python3-yaml package conflicts with nRF Python requirements
&& (apt-get remove -fy python3-yaml && apt-get autoremove || exit 0) \
&& python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/zephyr/scripts/requirements.txt \
&& python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/nrf/scripts/requirements.txt \
&& python3 -m pip install --no-cache-dir -r /opt/NordicSemiconductor/nrfconnect/bootloader/mcuboot/scripts/requirements.txt \
&& : # last line

ENV NRF5_TOOLS_ROOT=/opt/NordicSemiconductor/nRF5_tools
Expand Down
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-build/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.25 Version bump reason: [Telink] Implement Docker best practices
0.5.26 Version bump reason: [nRF Connect] Implement Docker best practices