diff --git a/scripts/docker-apt-clean b/scripts/docker-apt-clean index 95b970a..af86fd1 100755 --- a/scripts/docker-apt-clean +++ b/scripts/docker-apt-clean @@ -9,12 +9,10 @@ # effect as running `apt-get clean` but circumvents the deadlock. DIR=/ -STATE=var/lib/apt/ CACHE=var/cache/apt/ eval $(apt-config shell DIR Dir) -eval $(apt-config shell STATE Dir::State) eval $(apt-config shell CACHE Dir::Cache) -find $DIR$STATE -type f -delete -find $DIR$CACHE -type f -delete +find $DIR$CACHE -type f -name '*.deb' -delete +find $DIR$CACHE -type f -name '*.bin' -delete diff --git a/scripts/remove-apt-lists b/scripts/remove-apt-lists new file mode 100644 index 0000000..6e576f8 --- /dev/null +++ b/scripts/remove-apt-lists @@ -0,0 +1,17 @@ +#!/bin/sh +# remove-apt-lists -- to keep Docker image size small +# Copyright (C) 2017 Olaf Meeuwissen +# +# License: GPL-3.0+ + +# There is no convenient Post-Invoke hook anywhere to hang this onto +# but it is nice to be able to clean up the package index files when +# you want to save space. + +DIR=/ +STATE=var/lib/apt/ + +eval $(apt-config shell DIR Dir) +eval $(apt-config shell STATE Dir::State) + +find $DIR$STATE -type f -name '*_dists_*' -delete