From bc02fd0c6353f812ccfc8250c79c88b7954b8899 Mon Sep 17 00:00:00 2001 From: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> Date: Wed, 26 Oct 2022 18:52:22 -0400 Subject: [PATCH] Don't use centipede's install script (#8870) We can't simply autoremove the packages it installs and it adds 500 MB to the image size. Install the only dependency we don't already have libssl-dev since it is very small anyway. --- infra/base-images/base-builder/precompile_centipede | 6 +++--- projects/envoy/Dockerfile | 3 ++- projects/libraw/Dockerfile | 2 +- projects/librdkafka/Dockerfile | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/infra/base-images/base-builder/precompile_centipede b/infra/base-images/base-builder/precompile_centipede index f14cb7133dc6..6af9d562f15b 100755 --- a/infra/base-images/base-builder/precompile_centipede +++ b/infra/base-images/base-builder/precompile_centipede @@ -19,7 +19,8 @@ echo -n "Precompiling centipede" # Build Centipede with bazel. cd "$SRC/centipede/" -./install_dependencies_debian.sh +apt-get install libssl-dev -y +unset CXXFLAGS CFLAGS echo 'build --cxxopt=-stdlib=libc++ --linkopt=-lc++' >> /tmp/centipede.bazelrc bazel --bazelrc=/tmp/centipede.bazelrc build -c opt :all @@ -29,8 +30,7 @@ bazel --bazelrc=/tmp/centipede.bazelrc build -c opt :all # data-flow tracing flags, but will still throw errors when they cannot find # the corresponding functions. # The weak symbols provides fake implementations for intermediate binaries. -/clang/bin/clang++ "$SRC/centipede/weak_sancov_stubs.cc" -c -o \ - "$SRC/centipede/weak.o" +$CXX "$SRC/centipede/weak_sancov_stubs.cc" -c -o "$SRC/centipede/weak.o" echo 'Removing extra stuff leftover to avoid bloating image.' diff --git a/projects/envoy/Dockerfile b/projects/envoy/Dockerfile index 5055acc0fa46..57751c7d36a3 100644 --- a/projects/envoy/Dockerfile +++ b/projects/envoy/Dockerfile @@ -27,7 +27,8 @@ RUN apt-get update && apt-get -y install \ libtool \ wget \ golang \ - rsync + rsync \ + python3 RUN git clone https://github.com/envoyproxy/envoy.git WORKDIR $SRC/envoy/ diff --git a/projects/libraw/Dockerfile b/projects/libraw/Dockerfile index 7ed9213099a1..e122c6c74a72 100644 --- a/projects/libraw/Dockerfile +++ b/projects/libraw/Dockerfile @@ -15,7 +15,7 @@ ################################################################################ FROM gcr.io/oss-fuzz-base/base-builder -RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config +RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config zlib1g-dev RUN git clone --depth 1 https://github.com/libraw/libraw WORKDIR libraw diff --git a/projects/librdkafka/Dockerfile b/projects/librdkafka/Dockerfile index 43a2c2a49057..d00ebe42e735 100755 --- a/projects/librdkafka/Dockerfile +++ b/projects/librdkafka/Dockerfile @@ -14,7 +14,7 @@ # ################################################################################ FROM gcr.io/oss-fuzz-base/base-builder -RUN apt-get update && apt-get install -y make cmake flex bison +RUN apt-get update && apt-get install -y make cmake flex bison zlib1g-dev RUN git clone https://github.com/edenhill/librdkafka WORKDIR $SRC