Packer build templates are provided to build Vagrant boxes locally or to build and publish a Vagrant box on Vagrant Cloud.
- Install Vagrant.
- Run
packer build alpine.jsonto build the OVA. - Import the generated OVA into VirtualBox.
From the vagrant directory run packer build vagrant.json
You can then use vagrant commands to add, init, and run the box.
- You will need a Vagrant Cloud account.
- You will need to generate an authentication token.
- You will need to create a Box entry on Vagrant Cloud that will host the published box versions.
- Set the environment variable
ATLAS_TOKENto your Vagrant Cloud access token. - Edit vagrant-cloud.json and update
box_tagto match your Vagrant Cloud account name and box name. - Edit
box_versionand set a unique version number. - From the
vagrantdirectory runpacker build vagrant-cloud.json.
The published box is available with the following commands:
vagrant init <box_tag> \
--box-version <box_version>
vagrant up