1
- # start with Ubuntu 20.04LTS
2
- FROM ubuntu:focal
1
+ FROM ubuntu:24.04
3
2
LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip
4
3
5
4
VOLUME "/var/source"
@@ -30,7 +29,7 @@ RUN case ${TARGETPLATFORM} in \
30
29
# base build and check tools and libraries layer
31
30
RUN set -x \
32
31
&& apt-get update \
33
- && DEBIAN_FRONTEND=noninteractive apt-get install -fy --fix-missing \
32
+ && DEBIAN_FRONTEND=noninteractive apt-get install -fy --fix-missing --no-install-recommends \
34
33
autoconf \
35
34
automake \
36
35
bison \
@@ -39,23 +38,27 @@ RUN set -x \
39
38
clang \
40
39
clang-format \
41
40
clang-tidy \
41
+ cmake \
42
42
curl \
43
43
flex \
44
- g++-10 \
44
+ g++ \
45
+ generate-ninja \
45
46
git \
46
47
git-lfs \
47
48
gperf \
48
49
iproute2 \
50
+ iwyu \
49
51
jq \
50
52
lcov \
51
53
libavahi-client-dev \
52
54
libavahi-common-dev \
53
- libcairo-dev \
54
55
libcairo2-dev \
56
+ libcairo-dev \
55
57
libdbus-1-dev \
56
58
libdbus-glib-1-dev \
57
59
libdmalloc-dev \
58
60
libgif-dev \
61
+ libgirepository-1.0-1 \
59
62
libglib2.0-dev \
60
63
libical-dev \
61
64
libjpeg-dev \
@@ -68,8 +71,8 @@ RUN set -x \
68
71
libpango1.0-dev \
69
72
libpixman-1-dev \
70
73
libreadline-dev \
71
- libsdl-pango-dev \
72
74
libsdl2-dev \
75
+ libsdl-pango-dev \
73
76
libssl-dev \
74
77
libtool \
75
78
libudev-dev \
@@ -80,11 +83,19 @@ RUN set -x \
80
83
meson \
81
84
net-tools \
82
85
ninja-build \
86
+ nodejs \
87
+ patch \
83
88
pkg-config \
89
+ python3 \
90
+ python3-click \
91
+ python3-coloredlogs \
92
+ python3-dev \
93
+ python3-future \
94
+ python3-pandas \
95
+ python3-pip \
96
+ python3-tabulate \
97
+ python3-venv \
84
98
python-is-python3 \
85
- python3.9 \
86
- python3.9-dev \
87
- python3.9-venv \
88
99
rsync \
89
100
shellcheck \
90
101
strace \
@@ -97,73 +108,19 @@ RUN set -x \
97
108
&& git lfs install \
98
109
&& : # last line
99
110
100
- # Set gcc 10 as a default compiler to work with TSAN
101
- RUN set -x \
102
- && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 \
103
- && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 \
104
- && update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 \
105
- && update-alternatives --set cc /usr/bin/gcc \
106
- && update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 \
107
- && update-alternatives --set c++ /usr/bin/g++ \
108
- && : # last line
109
-
110
- # Cmake v3.23.1
111
- ENV CMAKE_PLATFORM_VERSION=
112
- RUN case ${TARGETPLATFORM} in \
113
- "linux/amd64" ) CMAKE_PLATFORM_VERSION="x86_64" ;; \
114
- "linux/arm64" ) CMAKE_PLATFORM_VERSION="aarch64" ;; \
115
- *) \
116
- test -n "$TARGETPLATFORM" \
117
- echo "Unsupported platform ${TARGETPLATFORM}" \
118
- && return 1 ;\
119
- ;; \
120
- esac \
121
- && set -x \
122
- && (cd /tmp \
123
- && wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.23.1/cmake-3.23.1-Linux-$CMAKE_PLATFORM_VERSION.sh \
124
- && sh cmake-3.23.1-Linux-$CMAKE_PLATFORM_VERSION.sh --exclude-subdir --prefix=/usr/local \
125
- && rm -rf cmake-3.23.1-Linux-$CMAKE_PLATFORM_VERSION.sh) \
126
- && exec bash \
127
- && : # last line
128
-
129
- # Python 3.9 and PIP
130
- RUN set -x \
131
- && DEBIAN_FRONTEND=noninteractive apt-get update \
132
- && DEBIAN_FRONTEND=noninteractive apt-get install -y libgirepository1.0-dev \
133
- && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common \
134
- && add-apt-repository universe \
135
- && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
136
- && python3.9 get-pip.py \
137
- && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 \
138
- && rm -rf /var/lib/apt/lists/ \
139
- && : # last line
140
-
111
+ # NOTE: this install is NOT ideal as we are installing over system
112
+ # we should migrate to venvs for packages we do not directly have
113
+ # provided by the system
141
114
RUN set -x \
142
- && pip3 install --no-cache-dir \
115
+ && pip3 install --break-system-packages -- no-cache-dir --break-system-packages \
143
116
attrs \
144
- click \
145
- coloredlogs \
146
117
cxxfilt \
147
- future \
148
118
ghapi \
149
119
mobly \
150
- pandas \
151
120
portpicker \
152
121
pygit \
153
122
PyGithub \
154
123
ruff \
155
- tabulate \
156
- && : # last line
157
-
158
- # build and install gn
159
- RUN set -x \
160
- && git clone https://gn.googlesource.com/gn \
161
- && cd gn \
162
- && python3 build/gen.py \
163
- && ninja -C out \
164
- && cp out/gn /usr/local/bin \
165
- && cd .. \
166
- && rm -rf gn \
167
124
&& : # last line
168
125
169
126
# Install bloat comparison tools
@@ -172,38 +129,13 @@ RUN set -x \
172
129
&& mkdir -p bloaty/build \
173
130
&& cd bloaty/build \
174
131
&& cmake -DCMAKE_BUILD_TYPE=MinSizeRel ../ \
175
- && make -j8 \
132
+ && make -j$(nproc) \
176
133
&& strip bloaty \
177
134
&& make install \
178
135
&& cd ../.. \
179
136
&& rm -rf bloaty \
180
137
&& : # last line
181
138
182
- # Need newer version of include-what-you-use
183
- RUN set -x \
184
- && apt-get update \
185
- # Install build and runtime requirements for IWYU
186
- && DEBIAN_FRONTEND=noninteractive apt-get install -fy --fix-missing clang-12 libclang-12-dev \
187
- # Build and install IWYU
188
- && git clone --depth=1 --branch=clang_12 https://github.com/include-what-you-use/include-what-you-use.git \
189
- && mkdir -p include-what-you-use/build \
190
- && cd include-what-you-use/build \
191
- && cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr/lib/llvm-12 -DIWYU_LINK_CLANG_DYLIB=OFF .. \
192
- && make -j8 \
193
- && strip bin/include-what-you-use \
194
- && make install \
195
- # Save clang-12 files, so we can restore them after build dependencies cleanup
196
- && tar -cf clang-12-files.tar $(dpkg -L libclang-common-12-dev |grep /include) /usr/lib/llvm-12/lib/libLLVM-12.so.1 \
197
- # Cleanup build dependencies
198
- && apt autopurge -fy clang-12 libclang-12-dev \
199
- && rm -rf /var/lib/apt/lists/ \
200
- # Restore clang-12 files
201
- && tar -xf clang-12-files.tar -C / \
202
- # Cleanup
203
- && cd ../.. \
204
- && rm -rf include-what-you-use \
205
- && : # last line
206
-
207
139
# Build glib-2.0 from source with enabled thread sanitizer. This is needed for
208
140
# running CHIP tests with TSAN enabled. When running applications with TSAN
209
141
# all shared libraries should be built with TSAN enabled, otherwise TSAN might
@@ -219,7 +151,7 @@ RUN case ${TARGETPLATFORM} in \
219
151
&& git clone --depth=1 --branch=$GLIB_VERSION https://github.com/GNOME/glib.git \
220
152
&& CFLAGS="-O2 -g -fsanitize=thread" meson glib/build glib -Dtests=false \
221
153
&& DESTDIR=../build-image ninja -C glib/build install \
222
- && mv glib/build-image/usr/local/lib/x86_64-linux-gnu /lib* $LD_LIBRARY_PATH_TSAN \
154
+ && mv glib/build-image/usr/local/lib64 /lib* $LD_LIBRARY_PATH_TSAN \
223
155
&& rm -rf glib \
224
156
;; \
225
157
"linux/arm64" ) \
@@ -231,41 +163,6 @@ RUN case ${TARGETPLATFORM} in \
231
163
;; \
232
164
esac
233
165
234
- # NodeJS: install a newer version than what apt-get would read
235
- # This installs the latest LTS version of nodejs
236
- #
237
- # NodeJS is required by github actions, we use Wandalen/wretry.action@v1.3.0
238
- # and that seems to use the built-in node installation in the image
239
- #
240
- # This is not a CHIP dependency directly, but used by CI
241
- ENV CHIP_NODE_VERSION=v16.13.2
242
- ENV NODE_PLATFORM_VERSION=
243
- RUN case ${TARGETPLATFORM} in \
244
- "linux/amd64" ) NODE_PLATFORM_VERSION=x64;; \
245
- "linux/arm64" ) NODE_PLATFORM_VERSION=arm64;; \
246
- *) \
247
- test -n "$TARGETPLATFORM" \
248
- echo "Unsupported platform ${TARGETPLATFORM}" \
249
- && return 1 ;\
250
- ;; \
251
- esac \
252
- && set -x \
253
- && mkdir node_js \
254
- && cd node_js \
255
- && wget https://nodejs.org/dist/$CHIP_NODE_VERSION/node-$CHIP_NODE_VERSION-linux-$NODE_PLATFORM_VERSION.tar.xz \
256
- && tar xfvJ node-$CHIP_NODE_VERSION-linux-$NODE_PLATFORM_VERSION.tar.xz \
257
- && mv node-$CHIP_NODE_VERSION-linux-$NODE_PLATFORM_VERSION /opt/ \
258
- && ln -s /opt/node-$CHIP_NODE_VERSION-linux-$NODE_PLATFORM_VERSION /opt/node \
259
- && ln -s /opt/node/bin/* /usr/bin \
260
- && cd .. \
261
- && rm -rf node_js \
262
- && : # last line
263
-
264
166
# Some things that save space
265
167
# Protoc goes from 108M to 4.6M
266
168
RUN strip /usr/local/bin/protoc*
267
-
268
- # CMake documentation not needed, saves 34MB
269
- # /usr/local/man contains cmake documentation
270
- RUN rm -rf /usr/local/doc/cmake
271
- RUN rm -rf /usr/local/man
0 commit comments