Packer templates, mainly for use building boxes for Vagrant Cloud.
- Alpine Linux:
- Debian:
- Various distributions by maier:
Using alpine3.7
as an example:
cd alpine3.7
- Edit
alpine-3.7-x86_64.json
export VAGRANTCLOUD_USER="chriswayg"
to use the correct account name.export VAGRANTCLOUD_TOKEN="abcdefghijk.atlasv1..."
to be able to access the account.
Note, this is a local build and will intentionally fail on the post-processor. If it didn't, it would push every build up to Vagrant Cloud, probably not what is desired when the template is being developed, updated, and/or tested.
../build.sh local
vagrant box add alpine-3.7-local output.box
mkdir test && cd test
vagrant init alpine-3.7-local
vagrant up
Note, to debug the VM boot process change headless to false in the template. Optionally,
export PACKER_LOG=1
to see output from Packer.
../build.sh vagrantcloud
packer version && vagrant -v && vboxmanage --version
>>>>>>> maier-master
Packer v1.2.3
Vagrant 2.0.4
5.2.12r122591
Packer templates, mainly for use building boxes for Vagrant Cloud.
Latest versions of: packer, vagrant, and VirtualBox
Using centos7.5.1804
as an example:
cd centos7.5.1804
- Edit
centos-7.5.1804-x86_64.json
- Update
push.name
to use the correct account name. - And anything else that interests you (customize by editing anything applicable in the
scripts/
orhttp/
subdirectories.)
- Update
To perform a local build simply run, ../build.sh local
To perform the build integrated with Vagrant Cloud run, ../build.sh vagrantcloud
(Ensure that VAGRANTCLOUD_USER
and VAGRANTCLOUD_TOKEN
are set correctly.)
Note, this is a local build and will intentionally fail on the vagrant-cloud post-processor. If it didn't it would push every build up to Vagrant Cloud, probably not what is desired when the template is being developed, updated, and/or tested.
$ ../build.sh local
Note, to debug the VM boot process change headless to false in the template. Optionally, run
PACKER_LOG=1 packer build centos-7.5.1804-x86_64.json
to see additional debugging output from Packer.
This will act accordingly to how the variables were set in the environment and build.conf
.
$ ../build.sh vagrantcloud
- Create distribution specific directory structure by copying a previous release or a similar distribution.
$ mkdir centos7.x.y && cp -r centos7.5.1804/* centos7.x.7/.
- Change to the new directory
$ cd centos7.x.7
- Change the name of the packer configuration file
mv centos-7.5.1804-x86_64.json centos-7.x.7-x86_64.json
- Edit the new packer configuration file for the new distro/release
- Edit remaining files to update for new distro/release
Note: some of the older release templates still reference the previous Atlas configurations; to build those again the template files would need to be updated to use Vagrant Cloud rather than Atlas.