better cleanup for smaller images

master
Marc Wäckerlin 7 years ago
parent 4cd7f7cd3e
commit 51aa660402
  1. 6
      scripts/bootstrap-to-docker.sh

@ -219,10 +219,12 @@ EOF1
fi fi
sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true update 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 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 echo " ---- install ${instpkgs} to ${tmpdir}/${distro}-${arch}" 1>&2
sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true install -y ${instpkgs} 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 echo " ---- unmount filesystems in ${tmpdir}/${distro}-${arch}" 1>&2
for x in proc sys dev; do for x in proc sys dev; do
if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x; then if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x; then

Loading…
Cancel
Save