From a08918234f003c6d88fe29775c400be13a68f979 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 13 Oct 2023 14:49:19 -0400 Subject: [PATCH 1/2] Some cleanup and strips on the chip-build image --- .../docker/images/base/chip-build/Dockerfile | 17 ++++++++++++++--- .../docker/images/base/chip-build/version | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/integrations/docker/images/base/chip-build/Dockerfile b/integrations/docker/images/base/chip-build/Dockerfile index a3c4e23fb11210..677eb26cee9c43 100644 --- a/integrations/docker/images/base/chip-build/Dockerfile +++ b/integrations/docker/images/base/chip-build/Dockerfile @@ -80,7 +80,6 @@ RUN set -x \ meson \ net-tools \ ninja-build \ - openjdk-8-jdk \ pkg-config \ python-is-python3 \ python3.9 \ @@ -172,8 +171,9 @@ RUN set -x \ && git clone https://github.com/google/bloaty.git \ && mkdir -p bloaty/build \ && cd bloaty/build \ - && cmake ../ \ + && cmake -DCMAKE_BUILD_TYPE=MinSizeRel ../ \ && make -j8 \ + && strip bloaty \ && make install \ && cd ../.. \ && rm -rf bloaty \ @@ -188,8 +188,9 @@ RUN set -x \ && 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_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=/usr/lib/llvm-12 -DIWYU_LINK_CLANG_DYLIB=OFF .. \ + && 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 \ @@ -259,3 +260,13 @@ RUN case ${TARGETPLATFORM} in \ && 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 + diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index dcb1e104fdb4a5..0263af9f1516db 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -19 : [Silabs] Remove unnecessary files from the gecko-sdk for the docker image +20 : [Chip-build] Decrease some image sizes From 1f96d2b94b7c2a9ed7ccbcf7a02616d4fe2a7802 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 13 Oct 2023 14:59:53 -0400 Subject: [PATCH 2/2] Restyle --- integrations/docker/images/base/chip-build/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/integrations/docker/images/base/chip-build/Dockerfile b/integrations/docker/images/base/chip-build/Dockerfile index 677eb26cee9c43..b16429fcc8eab2 100644 --- a/integrations/docker/images/base/chip-build/Dockerfile +++ b/integrations/docker/images/base/chip-build/Dockerfile @@ -269,4 +269,3 @@ RUN strip /usr/local/bin/protoc* # /usr/local/man contains cmake documentation RUN rm -rf /usr/local/doc/cmake RUN rm -rf /usr/local/man -