File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ Examples:
38
38
| ` WRITE_SOURCE_DATE_EPOCH ` | Write the ` SOURCE_DATE_EPOCH ` value to a file | ` /dev/null ` |
39
39
| ` SNAPSHOT_ARCHIVE_BASE ` | Base URL of the snapshot | ` http://snapshot-cloudflare.debian.org/archive/ ` , etc. (See below) |
40
40
| ` BACKPORTS ` | Enable Debian backports | ` 0 ` |
41
+ | ` KEEP_CACHE ` | Keep apt cache | ` 1 ` |
41
42
42
43
Distribution-specific default values:
43
44
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ set -eux -o pipefail
34
34
35
35
. /etc/os-release
36
36
37
+ : " ${KEEP_CACHE:= 1} "
38
+
37
39
keep_apt_cache () {
38
40
rm -f /etc/apt/apt.conf.d/docker-clean
39
41
echo ' Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
@@ -59,7 +61,7 @@ case "${ID}" in
59
61
echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} debian-security/${snapshot} ${VERSION_CODENAME} -security main" >> /etc/apt/sources.list
60
62
echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} debian/${snapshot} ${VERSION_CODENAME} -updates main" >> /etc/apt/sources.list
61
63
if [ " ${BACKPORTS} " = 1 ]; then echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} debian/${snapshot} ${VERSION_CODENAME} -backports main" >> /etc/apt/sources.list; fi
62
- keep_apt_cache
64
+ if [ " ${KEEP_CACHE} " = 1 ] ; then keep_apt_cache; fi
63
65
;;
64
66
" ubuntu" )
65
67
: " ${SNAPSHOT_ARCHIVE_BASE:= http:// snapshot.ubuntu.com/ } "
@@ -75,7 +77,7 @@ case "${ID}" in
75
77
echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} ubuntu/${snapshot} ${VERSION_CODENAME} -security main restricted" >> /etc/apt/sources.list
76
78
echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} ubuntu/${snapshot} ${VERSION_CODENAME} -security universe" >> /etc/apt/sources.list
77
79
echo " deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE} ubuntu/${snapshot} ${VERSION_CODENAME} -security multiverse" >> /etc/apt/sources.list
78
- keep_apt_cache
80
+ if [ " ${KEEP_CACHE} " = 1 ] ; then keep_apt_cache; fi
79
81
# http://snapshot.ubuntu.com is redirected to https, so we have to install ca-certificates
80
82
export DEBIAN_FRONTEND=noninteractive
81
83
apt-get -o Acquire::https::Verify-Peer=false update >&2
You can’t perform that action at this time.
0 commit comments