Skip to content

Commit fc8609f

Browse files
Clean up apt-get lists after every apt package installation (#1)
It's somehow missing in some steps. Summary from GitHub Copilot: > This pull request optimizes the Dockerfile by improving image cleanliness and reducing its size. The changes ensure that temporary files created during package installation are removed to minimize the image's footprint. > > ### Dockerfile optimizations: > > * Added `rm -rf /var/lib/apt/lists/*` after installing `pipx` to clean up temporary files and reduce image size. (`[DockerfileR95](diffhunk://#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557R95)`) > * Added `rm -rf /var/lib/apt/lists/*` after installing `ruby-full` to remove unnecessary files and maintain a clean image. (`[DockerfileL176-R178](diffhunk://#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557L176-R178)`)
1 parent 649c667 commit fc8609f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ RUN git -c advice.detachedHead=0 clone --branch ${PYENV_VERSION} --depth 1 https
9292
ENV PIPX_BIN_DIR=/root/.local/bin
9393
ENV PATH=$PIPX_BIN_DIR:$PATH
9494
RUN apt-get update && apt-get install -y pipx \
95+
&& rm -rf /var/lib/apt/lists/* \
9596
&& pipx install poetry uv \
9697
# Preinstall common packages for each version
9798
&& for pyv in $(ls ${PYENV_ROOT}/versions/); do \
@@ -173,7 +174,8 @@ RUN mkdir /tmp/swiftly \
173174
### RUBY ###
174175

175176
RUN apt-get update && apt-get install -y --no-install-recommends \
176-
ruby-full
177+
ruby-full \
178+
&& rm -rf /var/lib/apt/lists/*
177179

178180
### RUST ###
179181

0 commit comments

Comments
 (0)