Create a Vagrant nginx ubuntu based box via Packer
- Clone
- Build
- Vagrant usage
- Publish
- Consume
git clone https://github.com/viv-garot/packer-nginx64
cd packer-nginx64
packer build nginx64.json
vagrant box add --name nginx64 nginx64-vbox.box
vagrant init -m nginx64
vagrant up
vagrant ssh
or
ssh vagrant@127.0.0.1 -p 2222
(password = vagrant) (port 2222 is hardcoded in bionic64.json)
vagrant destroy
vagrant box remove bionic64
vagrant cloud auth login
Note : If you have Two-Factor authentication enabled the login will fail with the bellow error
- Two-factor authentication is enabled! Vagrant Cloud does not support creating (VagrantCloud::Error::ClientError::RequestError)
access tokens via the API when the user has two-factor authentication
enabled. Please create an access token using the Vagrant Cloud website and store
the result in the 'ATLAS_TOKEN' environment variable.
- Create a token in Vagrant Cloud if not performed already
- And export the result in the 'ATLAS_TOKEN' environment variable
export ATLAS_TOKEN=<generated-token>
- Then try again to login
vagrant cloud auth login
vagrant cloud box create <user>/<box> --no-private
e.g.
vagrant cloud box create vivien/nginx64 --no-private
vagrant cloud publish --box-version `date +%y.%m.%d` \
--force --no-private --release <user>/<box> \
`date +%y.%m.%d` virtualbox nginx64-vbox.box
e.g.
vagrant cloud publish --box-version `date +%y.%m.%d` \
--force --no-private --release vivien/nginx64 \
`date +%y.%m.%d` virtualbox nginx64-vbox.box
mkdir myboxes
cd myboxes
vagrant init -m <user>/<box>
e.g.
vagrant init -m vivien/nginx64
vagrant up