How can I reduce the size of my Vagrant package (.box)?

I created a vagrant box from Ubuntu 14.04 LTS 64 bit desktop ISO file. The traveling box size is over 1.5GB.

  • How do I reduce the size of my Vagrant box?
  • How do I remove unnecessary files from an installed Ubuntu OS?
+3


source to share


1 answer


I would use (and modify if necessary) some existing Packer template . Usually they are already doing disk cleanup and minification.



Anyway, the idea is to remove unneeded packages and clean up large tmp files, apt cache, etc. Finally, clean up the disk image by writing zeros to make sure it shrinks optimally. See for example this and this example from Bento .

+4


source







All Articles