Merge pull request #154 from infosiftr/apt-get-dist-clean

Switch to new `apt-get dist-clean` command
This commit is contained in:
Tianon Gravi 2024-01-16 10:22:50 -08:00 committed by GitHub
commit 803a857219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 6 deletions

View File

@ -1,3 +1,4 @@
{{ include "shared" -}}
FROM {{ env.dist }}:{{ env.codename }}
RUN set -eux; \
@ -26,4 +27,4 @@ RUN set -eux; \
tzdata \
{{ ) else "" end -}}
; \
rm -rf /var/lib/apt/lists/*
{{ apt_get_dist_clean }}

View File

@ -1,3 +1,4 @@
{{ include "shared" -}}
FROM buildpack-deps:{{ env.codename }}-curl
RUN set -eux; \
@ -18,4 +19,4 @@ if [
# procps is very common in build systems, and is a reasonably small package
procps \
; \
rm -rf /var/lib/apt/lists/*
{{ apt_get_dist_clean }}

View File

@ -1,3 +1,4 @@
{{ include "shared" -}}
FROM buildpack-deps:{{ env.codename }}-scm
RUN set -ex; \
@ -45,4 +46,4 @@ RUN set -ex; \
xz-utils \
zlib1g-dev \
; \
rm -rf /var/lib/apt/lists/*
{{ apt_get_dist_clean }}

2
debian/sid/Dockerfile generated vendored
View File

@ -51,4 +51,4 @@ RUN set -ex; \
xz-utils \
zlib1g-dev \
; \
rm -rf /var/lib/apt/lists/*
apt-get dist-clean

2
debian/sid/curl/Dockerfile generated vendored
View File

@ -16,4 +16,4 @@ RUN set -eux; \
sq \
wget \
; \
rm -rf /var/lib/apt/lists/*
apt-get dist-clean

2
debian/sid/scm/Dockerfile generated vendored
View File

@ -17,4 +17,4 @@ RUN set -eux; \
# procps is very common in build systems, and is a reasonably small package
procps \
; \
rm -rf /var/lib/apt/lists/*
apt-get dist-clean

27
shared.jq Normal file
View File

@ -0,0 +1,27 @@
def apt_get_dist_clean:
if [
# only suites with APT 2.7.8+ have "apt-get dist-clean"
# https://tracker.debian.org/news/1492892/accepted-apt-278-source-into-unstable/
# https://tracker.debian.org/pkg/apt
# https://packages.debian.org/apt
"trixie", # TODO once 2.7.8 migrates to testing (and images are rebuilt), this should be removed!
"bookworm",
"bullseye",
"buster",
# https://launchpad.net/ubuntu/+source/apt
# https://packages.ubuntu.com/apt
"noble", # TODO once 2.7.8+ makes it into devel (and images are rebuilt), this should be removed!
"mantic",
"lunar",
"jammy",
"focal",
empty
] | index(env.codename) then
"rm -rf /var/lib/apt/lists/*"
else
"apt-get dist-clean"
end
;