From 51aa660402cf12f7cf2a6c3db940b07c47bca94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Mon, 16 Apr 2018 11:17:15 +0200 Subject: [PATCH] better cleanup for smaller images --- scripts/bootstrap-to-docker.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap-to-docker.sh b/scripts/bootstrap-to-docker.sh index 98344de..3cbcecc 100755 --- a/scripts/bootstrap-to-docker.sh +++ b/scripts/bootstrap-to-docker.sh @@ -219,10 +219,12 @@ EOF1 fi sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true update sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true -y dist-upgrade - echo " ---- cleanup ${instpkgs} to ${tmpdir}/${distro}-${arch}" 1>&2 - sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true autoremove --purge -y echo " ---- install ${instpkgs} to ${tmpdir}/${distro}-${arch}" 1>&2 sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true install -y ${instpkgs} + echo " ---- cleanup ${instpkgs} to ${tmpdir}/${distro}-${arch}" 1>&2 + sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true autoremove --purge -y + sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true clean + sudo rm -rf "${tmpdir}/${distro}-${arch}"/var/lib/apt/lists/* echo " ---- unmount filesystems in ${tmpdir}/${distro}-${arch}" 1>&2 for x in proc sys dev; do if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x; then