-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfiles to
ubuntu:24.04
(#33637)
* Update to ubuntu 24.04 and bump version * Fix comment * Dependencies update * Use the latest gcc by default * Fix up clang save & cleanup * More build fixes * Add more --break-system-packages * Do not remove libllvm17t64 ... I am unsure about that one * Remove it after all ... seems some size savings here * More cleanup * Drop alternative install * Install gcc without a specific version. Undoes #28478 * Need llvm18-dev as well * Update to lib64 paths * Also install xz * xz is in utils * Fix asr depends when no recommends is installed * Clean up infineon, make the curl download to NOT be silent * using -j8 is arbitrary ... use nproc instead * update what qemu means * Install patch for the qemu image build * Adapt Tizen Dockerfiles * Update ubuntu version * Update Dockerfile for chip-build-linux-qemu image * Restyle * Add ability to skip already built things, otherwise docker keeps re-building stuff * Docker image inspect is MUCH faster than docker images * Fix nrf build * Fix ameba dockerfile build * Fix cirque image build * Make imx image work * Make build ordering predictable * Fix k32w image build * Fix telink image build * Speed up android image build by a lot * Bump up espressif qemu build, do not use the 3-year old version * Update versions to match system package versions, so that bootstrap is faster * Make sure that patch is available in the base image, we seem to use it ocassionally * One documentation update * Also allow compilation of mbedos bits in the vscode image * Include what you use from system --------- Co-authored-by: Andrei Litvin <[email protected]> Co-authored-by: Maksymilian Knust <[email protected]> Co-authored-by: Jakub Latusek <[email protected]>
- Loading branch information
Showing
26 changed files
with
224 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 7 additions & 15 deletions
22
integrations/docker/images/base/chip-build-minimal/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# start with Ubuntu 20.04LTS | ||
FROM ubuntu:focal | ||
FROM ubuntu:24.04 | ||
LABEL org.opencontainers.image.source https://github.com/project-chip/connectedhomeip | ||
|
||
VOLUME "/var/source" | ||
|
@@ -30,7 +29,7 @@ RUN case ${TARGETPLATFORM} in \ | |
# base build and check tools and libraries layer | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --fix-missing \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --fix-missing --no-install-recommends \ | ||
autoconf \ | ||
automake \ | ||
bison \ | ||
|
@@ -39,23 +38,27 @@ RUN set -x \ | |
clang \ | ||
clang-format \ | ||
clang-tidy \ | ||
cmake \ | ||
curl \ | ||
flex \ | ||
g++-10 \ | ||
g++ \ | ||
generate-ninja \ | ||
git \ | ||
git-lfs \ | ||
gperf \ | ||
iproute2 \ | ||
iwyu \ | ||
jq \ | ||
lcov \ | ||
libavahi-client-dev \ | ||
libavahi-common-dev \ | ||
libcairo-dev \ | ||
libcairo2-dev \ | ||
libcairo-dev \ | ||
libdbus-1-dev \ | ||
libdbus-glib-1-dev \ | ||
libdmalloc-dev \ | ||
libgif-dev \ | ||
libgirepository-1.0-1 \ | ||
libglib2.0-dev \ | ||
libical-dev \ | ||
libjpeg-dev \ | ||
|
@@ -68,8 +71,8 @@ RUN set -x \ | |
libpango1.0-dev \ | ||
libpixman-1-dev \ | ||
libreadline-dev \ | ||
libsdl-pango-dev \ | ||
libsdl2-dev \ | ||
libsdl-pango-dev \ | ||
libssl-dev \ | ||
libtool \ | ||
libudev-dev \ | ||
|
@@ -80,11 +83,19 @@ RUN set -x \ | |
meson \ | ||
net-tools \ | ||
ninja-build \ | ||
nodejs \ | ||
patch \ | ||
pkg-config \ | ||
python3 \ | ||
python3-click \ | ||
python3-coloredlogs \ | ||
python3-dev \ | ||
python3-future \ | ||
python3-pandas \ | ||
python3-pip \ | ||
python3-tabulate \ | ||
python3-venv \ | ||
python-is-python3 \ | ||
python3.9 \ | ||
python3.9-dev \ | ||
python3.9-venv \ | ||
rsync \ | ||
shellcheck \ | ||
strace \ | ||
|
@@ -97,73 +108,19 @@ RUN set -x \ | |
&& git lfs install \ | ||
&& : # last line | ||
|
||
# Set gcc 10 as a default compiler to work with TSAN | ||
RUN set -x \ | ||
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10 \ | ||
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 \ | ||
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 \ | ||
&& update-alternatives --set cc /usr/bin/gcc \ | ||
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 \ | ||
&& update-alternatives --set c++ /usr/bin/g++ \ | ||
&& : # last line | ||
|
||
# Cmake v3.23.1 | ||
ENV CMAKE_PLATFORM_VERSION= | ||
RUN case ${TARGETPLATFORM} in \ | ||
"linux/amd64") CMAKE_PLATFORM_VERSION="x86_64";; \ | ||
"linux/arm64") CMAKE_PLATFORM_VERSION="aarch64";; \ | ||
*) \ | ||
test -n "$TARGETPLATFORM" \ | ||
echo "Unsupported platform ${TARGETPLATFORM}" \ | ||
&& return 1 ;\ | ||
;; \ | ||
esac \ | ||
&& set -x \ | ||
&& (cd /tmp \ | ||
&& wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.23.1/cmake-3.23.1-Linux-$CMAKE_PLATFORM_VERSION.sh \ | ||
&& sh cmake-3.23.1-Linux-$CMAKE_PLATFORM_VERSION.sh --exclude-subdir --prefix=/usr/local \ | ||
&& rm -rf cmake-3.23.1-Linux-$CMAKE_PLATFORM_VERSION.sh) \ | ||
&& exec bash \ | ||
&& : # last line | ||
|
||
# Python 3.9 and PIP | ||
RUN set -x \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y libgirepository1.0-dev \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common \ | ||
&& add-apt-repository universe \ | ||
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ | ||
&& python3.9 get-pip.py \ | ||
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 \ | ||
&& rm -rf /var/lib/apt/lists/ \ | ||
&& : # last line | ||
|
||
# NOTE: this install is NOT ideal as we are installing over system | ||
# we should migrate to venvs for packages we do not directly have | ||
# provided by the system | ||
RUN set -x \ | ||
&& pip3 install --no-cache-dir \ | ||
&& pip3 install --break-system-packages --no-cache-dir --break-system-packages \ | ||
attrs \ | ||
click \ | ||
coloredlogs \ | ||
cxxfilt \ | ||
future \ | ||
ghapi \ | ||
mobly \ | ||
pandas \ | ||
portpicker \ | ||
pygit \ | ||
PyGithub \ | ||
ruff \ | ||
tabulate \ | ||
&& : # last line | ||
|
||
# build and install gn | ||
RUN set -x \ | ||
&& git clone https://gn.googlesource.com/gn \ | ||
&& cd gn \ | ||
&& python3 build/gen.py \ | ||
&& ninja -C out \ | ||
&& cp out/gn /usr/local/bin \ | ||
&& cd .. \ | ||
&& rm -rf gn \ | ||
&& : # last line | ||
|
||
# Install bloat comparison tools | ||
|
@@ -172,38 +129,13 @@ RUN set -x \ | |
&& mkdir -p bloaty/build \ | ||
&& cd bloaty/build \ | ||
&& cmake -DCMAKE_BUILD_TYPE=MinSizeRel ../ \ | ||
&& make -j8 \ | ||
&& make -j$(nproc) \ | ||
&& strip bloaty \ | ||
&& make install \ | ||
&& cd ../.. \ | ||
&& rm -rf bloaty \ | ||
&& : # last line | ||
|
||
# Need newer version of include-what-you-use | ||
RUN set -x \ | ||
&& apt-get update \ | ||
# Install build and runtime requirements for IWYU | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -fy --fix-missing clang-12 libclang-12-dev \ | ||
# Build and install IWYU | ||
&& git clone --depth=1 --branch=clang_12 https://github.com/include-what-you-use/include-what-you-use.git \ | ||
&& mkdir -p include-what-you-use/build \ | ||
&& cd include-what-you-use/build \ | ||
&& cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr/lib/llvm-12 -DIWYU_LINK_CLANG_DYLIB=OFF .. \ | ||
&& make -j8 \ | ||
&& strip bin/include-what-you-use \ | ||
&& make install \ | ||
# Save clang-12 files, so we can restore them after build dependencies cleanup | ||
&& tar -cf clang-12-files.tar $(dpkg -L libclang-common-12-dev |grep /include) /usr/lib/llvm-12/lib/libLLVM-12.so.1 \ | ||
# Cleanup build dependencies | ||
&& apt autopurge -fy clang-12 libclang-12-dev \ | ||
&& rm -rf /var/lib/apt/lists/ \ | ||
# Restore clang-12 files | ||
&& tar -xf clang-12-files.tar -C / \ | ||
# Cleanup | ||
&& cd ../.. \ | ||
&& rm -rf include-what-you-use \ | ||
&& : # last line | ||
|
||
# Build glib-2.0 from source with enabled thread sanitizer. This is needed for | ||
# running CHIP tests with TSAN enabled. When running applications with TSAN | ||
# all shared libraries should be built with TSAN enabled, otherwise TSAN might | ||
|
@@ -219,7 +151,7 @@ RUN case ${TARGETPLATFORM} in \ | |
&& git clone --depth=1 --branch=$GLIB_VERSION https://github.com/GNOME/glib.git \ | ||
&& CFLAGS="-O2 -g -fsanitize=thread" meson glib/build glib -Dtests=false \ | ||
&& DESTDIR=../build-image ninja -C glib/build install \ | ||
&& mv glib/build-image/usr/local/lib/x86_64-linux-gnu/lib* $LD_LIBRARY_PATH_TSAN \ | ||
&& mv glib/build-image/usr/local/lib64/lib* $LD_LIBRARY_PATH_TSAN \ | ||
&& rm -rf glib \ | ||
;; \ | ||
"linux/arm64") \ | ||
|
@@ -231,41 +163,6 @@ RUN case ${TARGETPLATFORM} in \ | |
;; \ | ||
esac | ||
|
||
# NodeJS: install a newer version than what apt-get would read | ||
# This installs the latest LTS version of nodejs | ||
# | ||
# NodeJS is required by github actions, we use Wandalen/[email protected] | ||
# and that seems to use the built-in node installation in the image | ||
# | ||
# This is not a CHIP dependency directly, but used by CI | ||
ENV CHIP_NODE_VERSION=v16.13.2 | ||
ENV NODE_PLATFORM_VERSION= | ||
RUN case ${TARGETPLATFORM} in \ | ||
"linux/amd64") NODE_PLATFORM_VERSION=x64;; \ | ||
"linux/arm64") NODE_PLATFORM_VERSION=arm64;; \ | ||
*) \ | ||
test -n "$TARGETPLATFORM" \ | ||
echo "Unsupported platform ${TARGETPLATFORM}" \ | ||
&& return 1 ;\ | ||
;; \ | ||
esac \ | ||
&& set -x \ | ||
&& mkdir node_js \ | ||
&& cd node_js \ | ||
&& wget https://nodejs.org/dist/$CHIP_NODE_VERSION/node-$CHIP_NODE_VERSION-linux-$NODE_PLATFORM_VERSION.tar.xz \ | ||
&& tar xfvJ node-$CHIP_NODE_VERSION-linux-$NODE_PLATFORM_VERSION.tar.xz \ | ||
&& mv node-$CHIP_NODE_VERSION-linux-$NODE_PLATFORM_VERSION /opt/ \ | ||
&& ln -s /opt/node-$CHIP_NODE_VERSION-linux-$NODE_PLATFORM_VERSION /opt/node \ | ||
&& ln -s /opt/node/bin/* /usr/bin \ | ||
&& cd .. \ | ||
&& rm -rf node_js \ | ||
&& : # last line | ||
|
||
# Some things that save space | ||
# Protoc goes from 108M to 4.6M | ||
RUN strip /usr/local/bin/protoc* | ||
|
||
# CMake documentation not needed, saves 34MB | ||
# /usr/local/man contains cmake documentation | ||
RUN rm -rf /usr/local/doc/cmake | ||
RUN rm -rf /usr/local/man |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
54 : [Telink] Update Docker image (Zephyr update) | ||
55 : Update to Ubuntu 24.04 as the base build image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.