From b1c96d0c680b51209c2739781426d4d9725bfdf8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:44:54 +0000 Subject: [PATCH 1/9] Reduce docker image size by cleaning up ruby install artifacts Added cleanup steps to remove the ruby source directory and tarball after installation in: - docker/base/Dockerfile - docker/base/ubuntu-20-04.Dockerfile - docker/base/ubuntu-24-04.Dockerfile This will reduce the final image size. --- docker/base/Dockerfile | 4 +++- docker/base/ubuntu-20-04.Dockerfile | 4 +++- docker/base/ubuntu-24-04.Dockerfile | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index bd564d971b..8327575063 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -94,7 +94,9 @@ RUN apt-get install -y binutils xz-utils libyaml-dev libffi-dev zlib1g-dev && \ cd ruby-$RUBY_VERSION && \ ./configure && \ make -j$(nproc) && \ - make install + make install && \ + cd - && \ + rm -rf ruby-$RUBY_VERSION ruby-$RUBY_VERSION.tar.gz # Install OpenJDK 17 for Jazzer (Java fuzzer). # Copied from gcr.io/oss-fuzz-base/base-runner. diff --git a/docker/base/ubuntu-20-04.Dockerfile b/docker/base/ubuntu-20-04.Dockerfile index f44b239108..61214c3e2e 100644 --- a/docker/base/ubuntu-20-04.Dockerfile +++ b/docker/base/ubuntu-20-04.Dockerfile @@ -94,7 +94,9 @@ RUN apt-get install -y binutils xz-utils libyaml-dev libffi-dev zlib1g-dev && \ cd ruby-$RUBY_VERSION && \ ./configure && \ make -j$(nproc) && \ - make install + make install && \ + cd - && \ + rm -rf ruby-$RUBY_VERSION ruby-$RUBY_VERSION.tar.gz # Install OpenJDK 17 for Jazzer (Java fuzzer). # Copied from gcr.io/oss-fuzz-base/base-runner. diff --git a/docker/base/ubuntu-24-04.Dockerfile b/docker/base/ubuntu-24-04.Dockerfile index 7a63f5648e..a1b02ae8ef 100644 --- a/docker/base/ubuntu-24-04.Dockerfile +++ b/docker/base/ubuntu-24-04.Dockerfile @@ -71,7 +71,9 @@ RUN apt-get install -y binutils xz-utils libyaml-dev libffi-dev zlib1g-dev && \ cd ruby-$RUBY_VERSION && \ ./configure && \ make -j$(nproc) && \ - make install + make install && \ + cd - && \ + rm -rf ruby-$RUBY_VERSION ruby-$RUBY_VERSION.tar.gz # Install OpenJDK 17 for Jazzer (Java fuzzer). # Copied from gcr.io/oss-fuzz-base/base-runner. From c6fadcabc06095ddf8ae4a05600716cfc6b0aa3e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:49:15 +0000 Subject: [PATCH 2/9] Reduce docker image size by cleaning up ruby install artifacts Added cleanup steps to remove the ruby source directory and tarball after installation in: - docker/base/Dockerfile - docker/base/ubuntu-20-04.Dockerfile - docker/base/ubuntu-24-04.Dockerfile This will reduce the final image size. From 72f1568965c3c3e921451ff93a3d1b1fb080c4d0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 22:13:48 +0000 Subject: [PATCH 3/9] Reduce docker image size and fix apt updates - Clean up ruby installation artifacts in base dockerfiles. - Ensure `apt-get update` is run before installation steps to fix build failures. - Fix potential apt cache issues in `docker/chromium/base/ubuntu-24-04.Dockerfile`. --- docker/base/Dockerfile | 2 +- docker/base/ubuntu-20-04.Dockerfile | 2 +- docker/base/ubuntu-24-04.Dockerfile | 2 +- docker/chromium/base/ubuntu-24-04.Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index 8327575063..87d6aa9d80 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -87,7 +87,7 @@ RUN curl -sS https://releases.nixos.org/patchelf/patchelf-0.9/patchelf-0.9.tar.b rm -rf /tmp/patchelf-* # Install Ruby, for Ruby fuzzing. -RUN apt-get install -y binutils xz-utils libyaml-dev libffi-dev zlib1g-dev && \ +RUN apt-get update && apt-get install -y binutils xz-utils libyaml-dev libffi-dev zlib1g-dev && \ RUBY_VERSION=3.3.1 && \ curl -O https://cache.ruby-lang.org/pub/ruby/3.3/ruby-$RUBY_VERSION.tar.gz && \ tar -xvf ruby-$RUBY_VERSION.tar.gz && \ diff --git a/docker/base/ubuntu-20-04.Dockerfile b/docker/base/ubuntu-20-04.Dockerfile index 61214c3e2e..51e625a97a 100644 --- a/docker/base/ubuntu-20-04.Dockerfile +++ b/docker/base/ubuntu-20-04.Dockerfile @@ -87,7 +87,7 @@ RUN curl -sS https://releases.nixos.org/patchelf/patchelf-0.9/patchelf-0.9.tar.b rm -rf /tmp/patchelf-* # Install Ruby, for Ruby fuzzing. -RUN apt-get install -y binutils xz-utils libyaml-dev libffi-dev zlib1g-dev && \ +RUN apt-get update && apt-get install -y binutils xz-utils libyaml-dev libffi-dev zlib1g-dev && \ RUBY_VERSION=3.3.1 && \ curl -O https://cache.ruby-lang.org/pub/ruby/3.3/ruby-$RUBY_VERSION.tar.gz && \ tar -xvf ruby-$RUBY_VERSION.tar.gz && \ diff --git a/docker/base/ubuntu-24-04.Dockerfile b/docker/base/ubuntu-24-04.Dockerfile index a1b02ae8ef..f3487373bd 100644 --- a/docker/base/ubuntu-24-04.Dockerfile +++ b/docker/base/ubuntu-24-04.Dockerfile @@ -64,7 +64,7 @@ RUN curl -sS https://releases.nixos.org/patchelf/patchelf-0.9/patchelf-0.9.tar.b rm -rf /tmp/patchelf-* # Install Ruby, for Ruby fuzzing. -RUN apt-get install -y binutils xz-utils libyaml-dev libffi-dev zlib1g-dev && \ +RUN apt-get update && apt-get install -y binutils xz-utils libyaml-dev libffi-dev zlib1g-dev && \ RUBY_VERSION=3.3.1 && \ curl -O https://cache.ruby-lang.org/pub/ruby/3.3/ruby-$RUBY_VERSION.tar.gz && \ tar -xvf ruby-$RUBY_VERSION.tar.gz && \ diff --git a/docker/chromium/base/ubuntu-24-04.Dockerfile b/docker/chromium/base/ubuntu-24-04.Dockerfile index 9175f27410..a19ccff5f2 100644 --- a/docker/chromium/base/ubuntu-24-04.Dockerfile +++ b/docker/chromium/base/ubuntu-24-04.Dockerfile @@ -12,7 +12,7 @@ ENV UPDATE_WEB_TESTS True # Note: snapcraft installation seems to always fail. RUN ln -s /usr/local/bin/python3.11 /usr/local/bin/python3 -RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 +RUN apt-get update && echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 RUN dpkg --add-architecture i386 && \ From 375b990458a5ee6b4c833a3efaa49a774313db57 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 22:16:50 +0000 Subject: [PATCH 4/9] Reduce docker image size and fix apt updates - Clean up ruby installation artifacts in base dockerfiles. - Ensure `apt-get update` is run before installation steps to fix build failures. - Fix potential apt cache issues in `docker/chromium/base/ubuntu-24-04.Dockerfile`. From 2e33a9335dbb0aaa2d60431ae2501af7506df66c Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Tue, 16 Dec 2025 09:50:51 -0500 Subject: [PATCH 5/9] Fix Dockerfile to set font installer EULA acceptance --- docker/chromium/base/ubuntu-24-04.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/chromium/base/ubuntu-24-04.Dockerfile b/docker/chromium/base/ubuntu-24-04.Dockerfile index a19ccff5f2..9175f27410 100644 --- a/docker/chromium/base/ubuntu-24-04.Dockerfile +++ b/docker/chromium/base/ubuntu-24-04.Dockerfile @@ -12,7 +12,7 @@ ENV UPDATE_WEB_TESTS True # Note: snapcraft installation seems to always fail. RUN ln -s /usr/local/bin/python3.11 /usr/local/bin/python3 -RUN apt-get update && echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 +RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 RUN dpkg --add-architecture i386 && \ From f08c9ee05012ecd0700c11aa4a149654551b7ad8 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 14:51:35 +0000 Subject: [PATCH 6/9] Reduce docker image size and fix apt updates - Clean up ruby installation artifacts in base dockerfiles. - Ensure `apt-get update` is run before installation steps to fix build failures. - Fix potential apt cache issues in `docker/chromium/base/ubuntu-24-04.Dockerfile`. --- docker/chromium/base/ubuntu-24-04.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/chromium/base/ubuntu-24-04.Dockerfile b/docker/chromium/base/ubuntu-24-04.Dockerfile index 9175f27410..a19ccff5f2 100644 --- a/docker/chromium/base/ubuntu-24-04.Dockerfile +++ b/docker/chromium/base/ubuntu-24-04.Dockerfile @@ -12,7 +12,7 @@ ENV UPDATE_WEB_TESTS True # Note: snapcraft installation seems to always fail. RUN ln -s /usr/local/bin/python3.11 /usr/local/bin/python3 -RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 +RUN apt-get update && echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 RUN dpkg --add-architecture i386 && \ From 8fb79c53d5dd6eb8f336b7f12bbe0ac467bfca42 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 18:46:05 +0000 Subject: [PATCH 7/9] Reduce docker image size and fix apt updates - Clean up ruby installation artifacts in base dockerfiles. - Ensure `apt-get update` is run before installation steps to fix build failures. - Fix potential apt cache issues in `docker/chromium/base/ubuntu-24-04.Dockerfile`. From fa112d2ab953c3e8b08c3d4cc15de3c6832ba157 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Tue, 23 Dec 2025 12:14:26 -0500 Subject: [PATCH 8/9] Fix Dockerfile to streamline dependency installation --- docker/chromium/base/ubuntu-24-04.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/chromium/base/ubuntu-24-04.Dockerfile b/docker/chromium/base/ubuntu-24-04.Dockerfile index a19ccff5f2..9175f27410 100644 --- a/docker/chromium/base/ubuntu-24-04.Dockerfile +++ b/docker/chromium/base/ubuntu-24-04.Dockerfile @@ -12,7 +12,7 @@ ENV UPDATE_WEB_TESTS True # Note: snapcraft installation seems to always fail. RUN ln -s /usr/local/bin/python3.11 /usr/local/bin/python3 -RUN apt-get update && echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 +RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 RUN dpkg --add-architecture i386 && \ From fc97d9c360b4a5cd747f50ca388c39d8762e8f0b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 17:14:55 +0000 Subject: [PATCH 9/9] Reduce docker image size and fix apt updates - Clean up ruby installation artifacts in base dockerfiles. - Ensure `apt-get update` is run before installation steps to fix build failures. - Fix potential apt cache issues in `docker/chromium/base/ubuntu-24-04.Dockerfile`. --- docker/chromium/base/ubuntu-24-04.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/chromium/base/ubuntu-24-04.Dockerfile b/docker/chromium/base/ubuntu-24-04.Dockerfile index 9175f27410..a19ccff5f2 100644 --- a/docker/chromium/base/ubuntu-24-04.Dockerfile +++ b/docker/chromium/base/ubuntu-24-04.Dockerfile @@ -12,7 +12,7 @@ ENV UPDATE_WEB_TESTS True # Note: snapcraft installation seems to always fail. RUN ln -s /usr/local/bin/python3.11 /usr/local/bin/python3 -RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 +RUN apt-get update && echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && curl 'https://chromium.googlesource.com/chromium/src/+/main/build/install-build-deps.py?format=TEXT' | base64 -d > /tmp/install-build-deps.py && sed -i s/snapcraft/doesnotexist/ /tmp/install-build-deps.py && sed -i "s/if requires_pinned_linux_libc():/if False:/" /tmp/install-build-deps.py && chmod u+x /tmp/install-build-deps.py && /tmp/install-build-deps.py --backwards-compatible --no-prompt --no-chromeos-fonts --syms --lib32 RUN dpkg --add-architecture i386 && \