So this is well-known. defaults-builder could drop the cleanup of the apt lists, but that would severely increase the size of the images. I propose this could become an option, which would make the removal of /var/lib/apt/lists/* conditional in ubuntu-defaults-image:
# clean up files that we do not need
cat <<EOF > config/chroot_local-hooks/90_cleanup
#!/bin/sh
set -e
echo "$0: Removing unnecessary files..."
rm -vf /var/cache/apt/*cache.bin
rm -vf /var/lib/apt/lists/*_*
rm -vrf /tmp/*
EOF
The caches and /tmp/* etc. should still be cleaned.
So this is well-known. defaults-builder could drop the cleanup of the apt lists, but that would severely increase the size of the images. I propose this could become an option, which would make the removal of /var/lib/ apt/lists/ * conditional in ubuntu- defaults- image:
# clean up files that we do not need chroot_ local-hooks/ 90_cleanup apt/*cache. bin apt/lists/ *_*
cat <<EOF > config/
#!/bin/sh
set -e
echo "$0: Removing unnecessary files..."
rm -vf /var/cache/
rm -vf /var/lib/
rm -vrf /tmp/*
EOF
The caches and /tmp/* etc. should still be cleaned.