Go to file
Mitchell Hashimoto 16295dfbf3 builder/vmware: tests for vnc_port_* settings 2013-06-07 15:11:13 -07:00
builder builder/vmware: tests for vnc_port_* settings 2013-06-07 15:11:13 -07:00
command/build command/build: add more logging 2013-06-05 18:36:59 -07:00
communicator/ssh communicator/ssh: Add type for static passwords 2013-06-05 23:05:39 -07:00
packer packer: Support overrides in provisioners for each build 2013-06-07 10:35:26 -07:00
plugin builder/vmware: Start it. Creates disks so far... 2013-06-04 15:00:58 -07:00
provisioner/shell provisioner/shell: Support setting the execute command 2013-06-06 23:14:31 -07:00
.gitignore provisioner/shell: Basic run 2013-05-27 21:54:19 -07:00
Makefile Much better Makefile coupled with shell script 2013-05-23 21:57:30 -07:00
README.md Small README update 2013-05-08 21:09:19 -07:00
TODO.md builder/vmware: tests for vnc_port_* settings 2013-06-07 15:11:13 -07:00
build.sh Much better Makefile coupled with shell script 2013-05-23 21:57:30 -07:00
config.go builder/vmware: Start it. Creates disks so far... 2013-06-04 15:00:58 -07:00
config_test.go app: support merging configs 2013-05-08 20:40:04 -07:00
packer.go Signal handling, force quit after two interrupts 2013-06-03 22:40:05 -07:00
signal.go Signal handling, force quit after two interrupts 2013-06-03 22:40:05 -07:00

README.md

Packer

Packer is a tool for building identical machine images across multiple clouds.

Packer provides a framework and configuration format for creating identical machine images to launch into any environment, such as VirtualBox, VMware, Amazon EC2, etc. Because this build process is automated, you can develop in VirtualBox, then deploy to EC2 with an identical image.

Quick Start

First, get Packer by either downloading a pre-built Packer binary for your operating system or downloading and compiling Packer yourself.

After Packer is installed, build your first machine image.

$ packer build quick-start.json
...

Packer will build an AMI according to the "quick-start" template. The AMI will be available in your AWS account. To delete the AMI, you must manually delete it using the AWS console. Packer builds your images, it does not manage their lifecycle. Where they go, how they're run, etc. is up to you.

Templates

Templates are static configurations that describe what machine images you want to create, how to create them, and what format you finally want them to be in.

Packer reads a template and builds all the requested machine images in parallel.

Templates are written in TOML. TOML is a fantastic configuration language that you can learn in minutes, and is very human-readable as well.

First, a complete template is shown below. Then, the details and structure of a template are discussed:

name = "my-custom-image"

[builder.amazon-ebs]
source = "ami-de0d9eb7"

[provision]

  [provison.shell]
  type = "shell"
  path = "script.sh"

[output]

  [output.vagrant]

Templates are comprised of three parts:

  • builders (1 or more) specify how the initial running system is built.

  • provisioners (0 or more) specify how to install and configure software from within the base running system.

  • outputs (0 or more) specify what to do with the completed system. For example, these can output Vagrant-compatible boxes, gzipped files, etc.

Developing Packer

If you wish to work on Packer itself, you'll first need Go installed (version 1.1+ is required). Next, clone this repository then just type make. In a few moments, you'll have a working packer executable:

$ make
...
$ bin/packer
...

You can run tests by typing make test. This will run tests for Packer core along with all the core builders and commands and such that come with Packer.