Skip to content

Commit b3cd438

Browse files
authored
Reduced docker image size by 800mb (#402)
* Reduced docker image size by 800mb * Pin this to a version * First pass at modularizing this, but we should get this in, so stopping here
1 parent 52106cc commit b3cd438

File tree

4 files changed

+44
-31
lines changed

4 files changed

+44
-31
lines changed

.devcontainer/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
ARG BUILD_VERSION
2+
13
# All tools required for compilation belong in chip-build, forms "truth" for CHIP build tooling
2-
FROM connectedhomeip/chip-build
4+
FROM connectedhomeip/chip-build:${BUILD_VERSION}
35

46
# This Dockerfile contains things useful for an interactive development environment
57
ARG USERNAME=vscode

.devcontainer/devcontainer.json

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"name": "CHIP Ubuntu Development Environment",
3-
"dockerFile": "Dockerfile",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
// "BUILD_VERSION": "$(cat integrations/docker/images/chip-build/version)" // trying to get this to work
7+
"BUILD_VERSION": "0.2.7"
8+
}
9+
},
410
"runArgs": [
511
"--cap-add=SYS_PTRACE",
612
"--security-opt",
@@ -9,16 +15,16 @@
915
"remoteUser": "vscode",
1016
// Add the IDs of extensions you want installed when the container is created in the array below.
1117
"extensions": [
12-
"ms-azuretools.vscode-docker",
13-
"xaver.clang-format",
14-
"github.vscode-pull-request-github",
15-
"maelvalais.autoconf",
16-
"yzhang.markdown-all-in-one",
17-
"eamodio.gitlens",
18-
"yuichinukiyama.vscode-preview-server",
19-
"aaron-bond.better-comments",
20-
"foxundermoon.shell-format"
21-
],
18+
"ms-azuretools.vscode-docker",
19+
"xaver.clang-format",
20+
"github.vscode-pull-request-github",
21+
"maelvalais.autoconf",
22+
"yzhang.markdown-all-in-one",
23+
"eamodio.gitlens",
24+
"yuichinukiyama.vscode-preview-server",
25+
"aaron-bond.better-comments",
26+
"foxundermoon.shell-format"
27+
],
2228
// Use 'settings' to set *default* container specific settings.json values on container create.
2329
// You can edit these settings after create using File > Preferences > Settings > Remote.
2430
"settings": {

integrations/docker/images/chip-build/Dockerfile

+23-18
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,33 @@ VOLUME "/var/source"
77
RUN set -x \
88
&& apt-get update \
99
&& apt-get install -fy \
10-
git \
11-
curl \
12-
jq \
13-
make \
14-
autoconf \
15-
automake \
16-
libtool \
17-
pkg-config \
18-
g++ \
19-
clang-9 \
20-
clang-format-9 \
21-
clang-tidy-9 \
22-
lcov \
23-
shellcheck \
24-
libssl-dev \
25-
unzip \
26-
wget \
27-
libmbedtls-dev \
10+
git \
11+
curl \
12+
jq \
13+
make \
14+
autoconf \
15+
automake \
16+
libtool \
17+
pkg-config \
18+
g++ \
19+
clang-9 \
20+
clang-format-9 \
21+
clang-tidy-9 \
22+
lcov \
23+
shellcheck \
24+
libssl-dev \
25+
unzip \
26+
wget \
27+
libmbedtls-dev \
28+
&& rm -rf /var/lib/apt/lists/ \
2829
&& : # last line
2930

3031
# Install specific release of openssl
3132
RUN set -x \
3233
&& cd /tmp && wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1f.zip \
3334
&& mkdir -p /tmp/openssl && cd /tmp/openssl && unzip ../OpenSSL_1_1_1f.zip \
3435
&& cd /tmp/openssl/openssl-OpenSSL_1_1_1f && ./config && make && make install \
36+
&& rm -rf /tmp/OpenSSL_1_1_1f.zip \
3537
&& : # last line
3638

3739
# nRF5 SDK, needed for building Nordic Platform code
@@ -41,6 +43,7 @@ RUN set -x \
4143
&& (mkdir /var/nRF5_SDK_for_Thread_and_Zigbee \
4244
&& cd /var/nRF5_SDK_for_Thread_and_Zigbee \
4345
&& unzip /tmp/nRF5SDKforThreadandZigbee.zip) \
46+
&& rm -rf /tmp/nRF5SDKforThreadandZigbee.zip \
4447
&& : # last line
4548

4649
# Tools for flashing software on Nordic devices, and accessing device logs
@@ -51,6 +54,8 @@ RUN set -x \
5154
&& dpkg -i JLink_Linux_*.deb \
5255
&& dpkg -i nRF-Command-Line-Tools_*.deb \
5356
&& tar zxvf nRF-Command-Line-Tools_*.tar.gz) \
57+
&& rm -rf /var/nRF5_tools/*.tar.gz \
58+
&& rm -rf /var/nRF5_tools/*.deb \
5459
&& : # last line
5560

5661
# GNU ARM Embedded toolchain, cross compiler for various platform builds
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.6
1+
0.2.7

0 commit comments

Comments
 (0)