Skip to content

Commit

Permalink
Merge pull request #154 from infosiftr/apt-get-dist-clean
Browse files Browse the repository at this point in the history
Switch to new `apt-get dist-clean` command
  • Loading branch information
tianon authored Jan 16, 2024
2 parents bea86ea + 2b3a8b7 commit 803a857
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Dockerfile-curl.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ include "shared" -}}
FROM {{ env.dist }}:{{ env.codename }}

RUN set -eux; \
Expand Down Expand Up @@ -26,4 +27,4 @@ RUN set -eux; \
tzdata \
{{ ) else "" end -}}
; \
rm -rf /var/lib/apt/lists/*
{{ apt_get_dist_clean }}
3 changes: 2 additions & 1 deletion Dockerfile-scm.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ include "shared" -}}
FROM buildpack-deps:{{ env.codename }}-curl

RUN set -eux; \
Expand All @@ -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 }}
3 changes: 2 additions & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ include "shared" -}}
FROM buildpack-deps:{{ env.codename }}-scm

RUN set -ex; \
Expand Down Expand Up @@ -45,4 +46,4 @@ RUN set -ex; \
xz-utils \
zlib1g-dev \
; \
rm -rf /var/lib/apt/lists/*
{{ apt_get_dist_clean }}
2 changes: 1 addition & 1 deletion debian/sid/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion debian/sid/curl/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion debian/sid/scm/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions shared.jq
Original file line number Diff line number Diff line change
@@ -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
;

0 comments on commit 803a857

Please sign in to comment.