[github] remove more caches after downloading things (#133129)

This is generally good practice if the caches won't be reused (though
arguably pedantic for the `stage1-toolchain` stage).

`docker history` on comparable images showed that this saves a few
hundred MB on stage1, and ~60MB on the `apt-get` layer of
`ci-container-agent`.
This commit is contained in:
George Burgess IV 2025-03-26 17:38:43 -06:00 committed by GitHub
parent 26bc1c6058
commit 78d7dd297f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,9 +14,13 @@ RUN apt-get update && \
python3 \
git \
curl \
zlib1g-dev
zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN curl -O -L https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-$LLVM_VERSION.tar.gz && tar -xf llvmorg-$LLVM_VERSION.tar.gz
RUN curl -O -L https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-$LLVM_VERSION.tar.gz && \
tar -xf llvmorg-$LLVM_VERSION.tar.gz && \
rm -f llvmorg-$LLVM_VERSION.tar.gz
WORKDIR /llvm-project-llvmorg-$LLVM_VERSION
@ -65,7 +69,9 @@ RUN apt-get update && \
python3-pip \
ccache \
file \
tzdata
tzdata && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install sccache as it is needed by most of the project test workflows and
# cannot be installed by the ccache action when executing as a non-root user.