Skip to content

Instantly share code, notes, and snippets.

@TomSchober
Last active December 14, 2016 15:28
Show Gist options
  • Save TomSchober/669a4406ee45ce9d7bacace89e2365ae to your computer and use it in GitHub Desktop.
Save TomSchober/669a4406ee45ce9d7bacace89e2365ae to your computer and use it in GitHub Desktop.
Prepare Vagrant Box for Packaging

####On the VM, Zero out the virtual disk

sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY

####Clear bash history

cat /dev/null > ~/.bash_history && history -c && exit

####Package

vagrant package --base VirtualMachineName

####Rename

mv package.box BoxName_0.0.0.box

####Copy to S3

aws s3 mv package.box s3://[path to bucket]/BoxName_0.0.0.box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment