3 [Packer][1] is a tool for automatically creating VM and container images,
4 configuring them and post-processing them into standard output formats.
8 You'll need to [install Packer][2], of course.
10 The Packer configuration is divided into build-specific variables,
11 output-specific templates and a set of shared provisioning scripts. To do a
12 specific build, combine the template for the desired output artifact type with
13 a variable file. To build a new basebuild instance the following would be done:
16 packer build -var-file=vars/cloud-env.json -var-file=vars/centos.json templates/basebuild.json
19 **NOTE:** vars/cloud-env.json is a gitignored file as it contains private
20 information. There is a vars/cloud-env.json.example file that may be used as a
21 base for creating the one needed.
23 This would build a bootable image in the project's CI cloud environment.
25 From a high level, the builds:
27 - Boot a specified base image in the cloud
28 - Run a set of shell scripts, listed in the template's shell provisioner
29 section, to do any configuration required by the builder.
30 - Execute a shutdown of the running instance
31 - Execute a 'nova image-create' operation against the shutdown instance.
32 - Perform a 'nova delete' operation against the shutdown instance.
34 [1]: https://www.packer.io/
35 [2]: https://www.packer.io/intro/getting-started/install.html