There are a handful of terms used throughout the Packer documentation where the meaning may not be immediately obvious if you haven't used Packer before. Luckily, there are relatively few. This page documents all the terminology required to understand and use Packer. The terminology is in alphabetical order for easy referencing.
The `amazon-chroot` Packer builder is able to create Amazon AMIs backed by an EBS volume as the root device. For more information on the difference between instance storage and EBS-backed instances, storage for the root device section in the EC2 documentation.
---
---
# AMI Builder (chroot)
# AMI Builder (chroot)
Type: `amazon-chroot`
Type: `amazon-chroot`
The `amazon-chroot` builder is able to create Amazon AMIs backed by
The `amazon-chroot`Packer builder is able to create Amazon AMIs backed by
an EBS volume as the root device. For more information on the difference
an EBS volume as the root device. For more information on the difference
between instance storage and EBS-backed instances, see the
between instance storage and EBS-backed instances, see the
["storage for the root device" section in the EC2 documentation](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device).
["storage for the root device" section in the EC2 documentation](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device).
The `amazon-ebs` Packer builder is able to create Amazon AMIs backed by EBS volumes for use in EC2. For more information on the difference betwen EBS-backed instances and instance-store backed instances, see the storage for the root device section in the EC2 documentation.
---
---
# AMI Builder (EBS backed)
# AMI Builder (EBS backed)
Type: `amazon-ebs`
Type: `amazon-ebs`
The `amazon-ebs` builder is able to create Amazon AMIs backed by EBS
The `amazon-ebs`Packer builder is able to create Amazon AMIs backed by EBS
volumes for use in [EC2](http://aws.amazon.com/ec2/). For more information
volumes for use in [EC2](http://aws.amazon.com/ec2/). For more information
on the difference betwen EBS-backed instances and instance-store backed
on the difference betwen EBS-backed instances and instance-store backed
The `amazon-instance` Packer builder is able to create Amazon AMIs backed by instance storage as the root device. For more information on the difference between instance storage and EBS-backed instances, see the storage for the root device section in the EC2 documentation.
---
---
# AMI Builder (instance-store)
# AMI Builder (instance-store)
Type: `amazon-instance`
Type: `amazon-instance`
The `amazon-instance` builder is able to create Amazon AMIs backed by
The `amazon-instance`Packer builder is able to create Amazon AMIs backed by
instance storage as the root device. For more information on the difference
instance storage as the root device. For more information on the difference
between instance storage and EBS-backed instances, see the
between instance storage and EBS-backed instances, see the
["storage for the root device" section in the EC2 documentation](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device).
["storage for the root device" section in the EC2 documentation](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device).
Packer is extensible, allowing you to write new builders without having to modify the core source code of Packer itself. Documentation for creating new builders is covered in the custom builders page of the Packer plugin section.
The `digitalocean` Packer builder is able to create new images for use with DigitalOcean. The builder takes a source image, runs any provisioning necessary on the image after launching it, then snapshots it into a reusable image. This reusable image can then be used as the foundation of new servers that are launched within DigitalOcean.
---
---
# DigitalOcean Builder
# DigitalOcean Builder
Type: `digitalocean`
Type: `digitalocean`
The `digitalocean` builder is able to create new images for use with
The `digitalocean`Packer builder is able to create new images for use with
[DigitalOcean](http://www.digitalocean.com). The builder takes a source
[DigitalOcean](http://www.digitalocean.com). The builder takes a source
image, runs any provisioning necessary on the image after launching it,
image, runs any provisioning necessary on the image after launching it,
then snapshots it into a reusable image. This reusable image can then be
then snapshots it into a reusable image. This reusable image can then be
The `docker` Packer builder builds Docker images using Docker. The builder starts a Docker container, runs provisioners within this container, then exports the container for reuse or commits the image.
---
---
# Docker Builder
# Docker Builder
Type: `docker`
Type: `docker`
The Docker builder builds [Docker](http://www.docker.io) images using
The `docker` Packer builder builds [Docker](http://www.docker.io) images using
Docker. The builder starts a Docker container, runs provisioners within
Docker. The builder starts a Docker container, runs provisioners within
this container, then exports the container for reuse or commits the image.
this container, then exports the container for reuse or commits the image.
The `googlecompute` Packer builder is able to create images for use with Google Compute Engine (GCE) based on existing images. Google Compute Engine doesn't allow the creation of images from scratch.
---
---
# Google Compute Builder
# Google Compute Builder
Type: `googlecompute`
Type: `googlecompute`
The `googlecompute` builder is able to create
The `googlecompute`Packer builder is able to create
The `null` Packer builder is not really a builder, it just sets up an SSH connection and runs the provisioners. It can be used to debug provisioners without incurring high wait times. It does not create any kind of image or artifact.
---
---
# Null Builder
# Null Builder
Type: `null`
Type: `null`
The null builder is not really a builder, it just sets up an SSH connection
The `null` Packer builder is not really a builder, it just sets up an SSH connection
and runs the provisioners. It can be used to debug provisioners without
and runs the provisioners. It can be used to debug provisioners without
incurring high wait times. It does not create any kind of image or artifact.
incurring high wait times. It does not create any kind of image or artifact.
The `openstack` Packer builder is able to create new images for use with OpenStack. The builder takes a source image, runs any provisioning necessary on the image after launching it, then creates a new reusable image. This reusable image can then be used as the foundation of new servers that are launched within OpenStack. The builder will create temporary keypairs that provide temporary access to the server while the image is being created. This simplifies configuration quite a bit.
---
---
# OpenStack Builder
# OpenStack Builder
Type: `openstack`
Type: `openstack`
The `openstack` builder is able to create new images for use with
The `openstack`Packer builder is able to create new images for use with
[OpenStack](http://www.openstack.org). The builder takes a source
[OpenStack](http://www.openstack.org). The builder takes a source
image, runs any provisioning necessary on the image after launching it,
image, runs any provisioning necessary on the image after launching it,
then creates a new reusable image. This reusable image can then be
then creates a new reusable image. This reusable image can then be
The Parallels Packer builder is able to create Parallels Desktop for Mac virtual machines and export them in the PVM format, starting from an ISO image.
---
---
# Parallels Builder (from an ISO)
# Parallels Builder (from an ISO)
Type: `parallels-iso`
Type: `parallels-iso`
The Parallels builder is able to create
The Parallels Packer builder is able to create
[Parallels Desktop for Mac](http://www.parallels.com/products/desktop/) virtual
[Parallels Desktop for Mac](http://www.parallels.com/products/desktop/) virtual
machines and export them in the PVM format, starting from an
machines and export them in the PVM format, starting from an
This Parallels builder is able to create Parallels Desktop for Mac virtual machines and export them in the PVM format, starting from an existing PVM (exported virtual machine image).
The Parallels Packer builder is able to create Parallels Desktop for Mac virtual machines and export them in the PVM format.
---
---
# Parallels Builder
# Parallels Builder
The Parallels builder is able to create [Parallels Desktop for Mac](http://www.parallels.com/products/desktop/) virtual machines and export them in the PVM format.
The Parallels Packer builder is able to create [Parallels Desktop for Mac](http://www.parallels.com/products/desktop/) virtual machines and export them in the PVM format.
Packer actually comes with multiple builders able to create Parallels
Packer actually comes with multiple builders able to create Parallels
machines, depending on the strategy you want to use to build the image.
machines, depending on the strategy you want to use to build the image.
This VirtualBox Packer builder is able to create VirtualBox virtual machines and export them in the OVF format, starting from an existing OVF/OVA (exported virtual machine image).
---
---
# VirtualBox Builder (from an OVF/OVA)
# VirtualBox Builder (from an OVF/OVA)
Type: `virtualbox-ovf`
Type: `virtualbox-ovf`
This VirtualBox builder is able to create [VirtualBox](https://www.virtualbox.org/)
This VirtualBox Packer builder is able to create [VirtualBox](https://www.virtualbox.org/)
virtual machines and export them in the OVF format, starting from an
virtual machines and export them in the OVF format, starting from an
This VMware Packer builder is able to create VMware virtual machines from an ISO file as a source. It currently supports building virtual machines on hosts running VMware Fusion for OS X, VMware Workstation for Linux and Windows, and VMware Player on Linux. It can also build machines directly on VMware vSphere Hypervisor using SSH as opposed to the vSphere API.
---
---
# VMware Builder (from ISO)
# VMware Builder (from ISO)
Type: `vmware-iso`
Type: `vmware-iso`
This VMware builder is able to create VMware virtual machines from an
This VMware Packer builder is able to create VMware virtual machines from an
ISO file as a source. It currently
ISO file as a source. It currently
supports building virtual machines on hosts running
supports building virtual machines on hosts running
[VMware Fusion](http://www.vmware.com/products/fusion/overview.html) for OS X,
[VMware Fusion](http://www.vmware.com/products/fusion/overview.html) for OS X,
This VMware Packer builder is able to create VMware virtual machines from an existing VMware virtual machine (a VMX file). It currently supports building virtual machines on hosts running VMware Fusion Professional for OS X, VMware Workstation for Linux and Windows, and VMware Player on Linux.
---
---
# VMware Builder (from VMX)
# VMware Builder (from VMX)
Type: `vmware-vmx`
Type: `vmware-vmx`
This VMware builder is able to create VMware virtual machines from an
This VMware Packer builder is able to create VMware virtual machines from an
existing VMware virtual machine (a VMX file). It currently
existing VMware virtual machine (a VMX file). It currently
supports building virtual machines on hosts running
supports building virtual machines on hosts running
[VMware Fusion Professional](http://www.vmware.com/products/fusion-professional/) for OS X,
[VMware Fusion Professional](http://www.vmware.com/products/fusion-professional/) for OS X,
The `packer build` Packer command takes a template and runs all the builds within it in order to generate a set of artifacts. The various builds specified within a template are executed in parallel, unless otherwise specified. And the artifacts that are created will be outputted at the end of the build.
---
---
# Command-Line: Build
# Command-Line: Build
The `packer build` command takes a template and runs all the builds within
The `packer build`Packer command takes a template and runs all the builds within
it in order to generate a set of artifacts. The various builds specified within
it in order to generate a set of artifacts. The various builds specified within
a template are executed in parallel, unless otherwise specified. And the
a template are executed in parallel, unless otherwise specified. And the
artifacts that are created will be outputted at the end of the build.
artifacts that are created will be outputted at the end of the build.
The `packer fix` Packer command takes a template and finds backwards incompatible parts of it and brings it up to date so it can be used with the latest version of Packer. After you update to a new Packer release, you should run the fix command to make sure your templates work with the new release.
---
---
# Command-Line: Fix
# Command-Line: Fix
The `packer fix` command takes a template and finds backwards incompatible
The `packer fix`Packer command takes a template and finds backwards incompatible
parts of it and brings it up to date so it can be used with the latest version
parts of it and brings it up to date so it can be used with the latest version
of Packer. After you update to a new Packer release, you should run the
of Packer. After you update to a new Packer release, you should run the
fix command to make sure your templates work with the new release.
fix command to make sure your templates work with the new release.
The `packer inspect` Packer command takes a template and outputs the various components a template defines. This can help you quickly learn about a template without having to dive into the JSON itself. The command will tell you things like what variables a template accepts, the builders it defines, the provisioners it defines and the order they'll run, and more.
---
---
# Command-Line: Inspect
# Command-Line: Inspect
The `packer inspect` command takes a template and outputs the various components
The `packer inspect`Packer command takes a template and outputs the various components
a template defines. This can help you quickly learn about a template without
a template defines. This can help you quickly learn about a template without
having to dive into the JSON itself.
having to dive into the JSON itself.
The command will tell you things like what variables a template accepts,
The command will tell you things like what variables a template accepts,
Packer is controlled using a command-line interface. All interaction with Packer is done via the `packer` tool. Like many other command-line tools, the `packer` tool takes a subcommand to execute, and that subcommand may have additional options as well. Subcommands are executed with `packer SUBCOMMAND`, where "SUBCOMMAND" is obviously the actual command you wish to execute.
By default, the output of Packer is very human-readable. It uses nice formatting, spacing, and colors in order to make Packer a pleasure to use. However, Packer was built with automation in mind. To that end, Packer supports a fully machine-readable output setting, allowing you to use Packer in automated environments.
The `packer validate` Packer command is used to validate the syntax and configuration of a template. The command will return a zero exit status on success, and a non-zero exit status on failure. Additionally, if a template doesn't validate, any error messages will be outputted.
---
---
# Command-Line: Validate
# Command-Line: Validate
The `packer validate` command is used to validate the syntax and configuration
The `packer validate`Packer command is used to validate the syntax and configuration
of a [template](/docs/templates/introduction.html). The command will return
of a [template](/docs/templates/introduction.html). The command will return
a zero exit status on success, and a non-zero exit status on failure. Additionally,
a zero exit status on success, and a non-zero exit status on failure. Additionally,
if a template doesn't validate, any error messages will be outputted.
if a template doesn't validate, any error messages will be outputted.
Packer Builders are the components of Packer responsible for creating a machine, bringing it to a point where it can be provisioned, and then turning that provisioned machine into some sort of machine image. Several builders are officially distributed with Packer itself, such as the AMI builder, the VMware builder, etc. However, it is possible to write custom builders using the Packer plugin interface, and this page documents how to do that.
---
---
# Custom Builder Development
# Custom Builder Development
Builders are the components of Packer responsible for creating a machine,
Packer Builders are the components of Packer responsible for creating a machine,
bringing it to a point where it can be provisioned, and then turning
bringing it to a point where it can be provisioned, and then turning
that provisioned machine into some sort of machine image. Several builders
that provisioned machine into some sort of machine image. Several builders
are officially distributed with Packer itself, such as the AMI builder, the
are officially distributed with Packer itself, such as the AMI builder, the
Packer Commands are the components of Packer that add functionality to the `packer` application. Packer comes with a set of commands out of the box, such as `build`. Commands are invoked as `packer <COMMAND>`. Custom commands allow you to add new commands to Packer to perhaps perform new functionality.
---
---
# Custom Command Development
# Custom Command Development
Commands are the components of Packer that add functionality to the
Packer Commands are the components of Packer that add functionality to the
`packer` application. Packer comes with a set of commands out of the
`packer` application. Packer comes with a set of commands out of the
box, such as `build`. Commands are invoked as `packer <COMMAND>`.
box, such as `build`. Commands are invoked as `packer <COMMAND>`.
Custom commands allow you to add new commands to Packer to perhaps
Custom commands allow you to add new commands to Packer to perhaps
This page will document how you can develop your own Packer plugins. Prior to reading this, it is assumed that you're comfortable with Packer and also know the basics of how Plugins work, from a user standpoint.
Packer Plugins allow new functionality to be added to Packer without modifying the core source code. Packer plugins are able to add new commands, builders, provisioners, hooks, and more. In fact, much of Packer itself is implemented by writing plugins that are simply distributed with Packer. For example, all the commands, builders, provisioners, and more that ship with Packer are implemented as Plugins that are simply hardcoded to load with Packer.
---
---
# Packer Plugins
# Packer Plugins
Plugins allow new functionality to be added to Packer without
Packer Plugins allow new functionality to be added to Packer without
modifying the core source code. Packer plugins are able to add new
modifying the core source code. Packer plugins are able to add new
commands, builders, provisioners, hooks, and more. In fact, much of Packer
commands, builders, provisioners, hooks, and more. In fact, much of Packer
itself is implemented by writing plugins that are simply distributed with
itself is implemented by writing plugins that are simply distributed with
Packer Provisioners are the components of Packer that install and configure software into a running machine prior to turning that machine into an image. An example of a provisioner is the shell provisioner, which runs shell scripts within the machines.
---
---
# Custom Provisioner Development
# Custom Provisioner Development
Provisioners are the components of Packer that install and configure
Packer Provisioners are the components of Packer that install and configure
software into a running machine prior to turning that machine into an
software into a running machine prior to turning that machine into an
image. An example of a provisioner is the [shell provisioner](/docs/provisioners/shell.html),
image. An example of a provisioner is the [shell provisioner](/docs/provisioners/shell.html),
Welcome to the Packer documentation! This documentation is more of a reference guide for all available features and options in Packer. If you're just getting started with Packer, please start with the introduction and getting started guide instead.
Packer must first be installed on the machine you want to run it on. To make installation easy, Packer is distributed as a binary package for all supported platforms and architectures. This page will not cover how to compile Packer from source, as that is covered in the README and is only recommended for advanced users.
This is the reference for the various message categories for Packer machine-readable output. Please read that page if you're unfamiliar with the general format and usage for the machine-readable output.
There are a few configuration settings that affect Packer globally by configuring the core of Packer. These settings all have reasonable defaults, so you generally don't have to worry about it until you want to tweak a configuration. If you're just getting started with Packer, don't worry about core configuration for now.
Packer strives to be stable and bug-free, but issues inevitably arise where certain things may not work entirely correctly, or may not appear to work correctly. In these cases, it is sometimes helpful to see more details about what Packer is actually doing.
The Packer compress post-processor takes an artifact with files (such as from VMware or VirtualBox) and gzip compresses the artifact into a single archive.
---
---
# Compress Post-Processor
# Compress Post-Processor
Type: `compress`
Type: `compress`
The compress post-processor takes an artifact with files (such as from
The Packer compress post-processor takes an artifact with files (such as from
VMware or VirtualBox) and gzip compresses the artifact into a single
VMware or VirtualBox) and gzip compresses the artifact into a single
The Packer Docker import post-processor takes an artifact from the docker builder and imports it with Docker locally. This allows you to apply a repository and tag to the image and lets you use the other Docker post-processors such as docker-push to push the image to a registry.
---
---
# Docker Import Post-Processor
# Docker Import Post-Processor
Type: `docker-import`
Type: `docker-import`
The Docker import post-processor takes an artifact from the
The Packer Docker import post-processor takes an artifact from the
[docker builder](/docs/builders/docker.html) and imports it with Docker
[docker builder](/docs/builders/docker.html) and imports it with Docker
locally. This allows you to apply a repository and tag to the image
locally. This allows you to apply a repository and tag to the image
and lets you use the other Docker post-processors such as
and lets you use the other Docker post-processors such as
The Packer Docker Save post-processor takes an artifact from the docker builder that was committed and saves it to a file. This is similar to exporting the Docker image directly from the builder, except that it preserves the hierarchy of images and metadata.
---
---
# Docker Save Post-Processor
# Docker Save Post-Processor
Type: `docker-save`
Type: `docker-save`
The Docker Save post-processor takes an artifact from the
The Packer Docker Save post-processor takes an artifact from the
[docker builder](/docs/builders/docker.html) that was committed
[docker builder](/docs/builders/docker.html) that was committed
and saves it to a file. This is similar to exporting the Docker image
and saves it to a file. This is similar to exporting the Docker image
directly from the builder, except that it preserves the hierarchy of
directly from the builder, except that it preserves the hierarchy of
The Packer Docker Tag post-processor takes an artifact from the docker builder that was committed and tags it into a repository. This allows you to use the other Docker post-processors such as docker-push to push the image to a registry.
---
---
# Docker Tag Post-Processor
# Docker Tag Post-Processor
Type: `docker-tag`
Type: `docker-tag`
The Docker Tag post-processor takes an artifact from the
The Packer Docker Tag post-processor takes an artifact from the
[docker builder](/docs/builders/docker.html) that was committed
[docker builder](/docs/builders/docker.html) that was committed
and tags it into a repository. This allows you to use the other
and tags it into a repository. This allows you to use the other
The Packer Vagrant Cloud post-processor receives a Vagrant box from the `vagrant` post-processor and pushes it to Vagrant Cloud. Vagrant Cloud hosts and serves boxes to Vagrant, allowing you to version and distribute boxes to an organization in a simple way.
---
---
# Vagrant Cloud Post-Processor
# Vagrant Cloud Post-Processor
Type: `vagrant-cloud`
Type: `vagrant-cloud`
The Vagrant Cloud post-processor receives a Vagrant box from the `vagrant`
The Packer Vagrant Cloud post-processor receives a Vagrant box from the `vagrant`
post-processor and pushes it to Vagrant Cloud. [Vagrant Cloud](https://vagrantcloud.com)
post-processor and pushes it to Vagrant Cloud. [Vagrant Cloud](https://vagrantcloud.com)
hosts and serves boxes to Vagrant, allowing you to version and distribute
hosts and serves boxes to Vagrant, allowing you to version and distribute
The Packer Vagrant post-processor takes a build and converts the artifact into a valid Vagrant box, if it can. This lets you use Packer to automatically create arbitrarily complex Vagrant boxes, and is in fact how the official boxes distributed by Vagrant are created.
---
---
# Vagrant Post-Processor
# Vagrant Post-Processor
Type: `vagrant`
Type: `vagrant`
The Vagrant post-processor takes a build and converts the artifact
The Packer Vagrant post-processor takes a build and converts the artifact
into a valid [Vagrant](http://www.vagrantup.com) box, if it can.
into a valid [Vagrant](http://www.vagrantup.com) box, if it can.
This lets you use Packer to automatically create arbitrarily complex
This lets you use Packer to automatically create arbitrarily complex
Vagrant boxes, and is in fact how the official boxes distributed by
Vagrant boxes, and is in fact how the official boxes distributed by
The `ansible-local` Packer provisioner configures Ansible to run on the machine by Packer from local Playbook and Role files. Playbooks and Roles can be uploaded from your local machine to the remote machine. Ansible is run in local mode via the `ansible-playbook` command.
---
---
# Ansible Local Provisioner
# Ansible Local Provisioner
Type: `ansible-local`
Type: `ansible-local`
The `ansible-local` provisioner configures Ansible to run on the machine by
The `ansible-local`Packer provisioner configures Ansible to run on the machine by
Packer from local Playbook and Role files. Playbooks and Roles can be uploaded
Packer from local Playbook and Role files. Playbooks and Roles can be uploaded
from your local machine to the remote machine. Ansible is run in [local mode](http://docs.ansible.com/playbooks_delegation.html#local-playbooks) via the `ansible-playbook` command.
from your local machine to the remote machine. Ansible is run in [local mode](http://docs.ansible.com/playbooks_delegation.html#local-playbooks) via the `ansible-playbook` command.
The Chef Client Packer provisioner installs and configures software on machines built by Packer using chef-client. Packer configures a Chef client to talk to a remote Chef Server to provision the machine.
---
---
# Chef Client Provisioner
# Chef Client Provisioner
Type: `chef-client`
Type: `chef-client`
The Chef Client provisioner installs and configures software on machines built
The Chef Client Packer provisioner installs and configures software on machines built
by Packer using [chef-client](http://docs.opscode.com/chef_client.html).
by Packer using [chef-client](http://docs.opscode.com/chef_client.html).
Packer configures a Chef client to talk to a remote Chef Server to
Packer configures a Chef client to talk to a remote Chef Server to
The Chef solo Packer provisioner installs and configures software on machines built by Packer using chef-solo. Cookbooks can be uploaded from your local machine to the remote machine or remote paths can be used.
---
---
# Chef Solo Provisioner
# Chef Solo Provisioner
Type: `chef-solo`
Type: `chef-solo`
The Chef solo provisioner installs and configures software on machines built
The Chef solo Packer provisioner installs and configures software on machines built
by Packer using [chef-solo](http://docs.opscode.com/chef_solo.html). Cookbooks
by Packer using [chef-solo](http://docs.opscode.com/chef_solo.html). Cookbooks
can be uploaded from your local machine to the remote machine or remote paths
can be uploaded from your local machine to the remote machine or remote paths
Packer is extensible, allowing you to write new provisioners without having to modify the core source code of Packer itself. Documentation for creating new provisioners is covered in the custom provisioners page of the Packer plugin section.
The file Packer provisioner uploads files to machines built by Packer. The recommended usage of the file provisioner is to use it to upload files, and then use shell provisioner to move them to the proper place, set permissions, etc.
---
---
# File Provisioner
# File Provisioner
Type: `file`
Type: `file`
The file provisioner uploads files to machines built by Packer. The
The file Packer provisioner uploads files to machines built by Packer. The
recommended usage of the file provisioner is to use it to upload files,
recommended usage of the file provisioner is to use it to upload files,
and then use [shell provisioner](/docs/provisioners/shell.html) to move
and then use [shell provisioner](/docs/provisioners/shell.html) to move
The masterless Puppet Packer provisioner configures Puppet to run on the machines by Packer from local modules and manifest files. Modules and manifests can be uploaded from your local machine to the remote machine or can simply use remote paths (perhaps obtained using something like the shell provisioner). Puppet is run in masterless mode, meaning it never communicates to a Puppet master.
---
---
# Puppet (Masterless) Provisioner
# Puppet (Masterless) Provisioner
Type: `puppet-masterless`
Type: `puppet-masterless`
The masterless Puppet provisioner configures Puppet to run on the machines
The masterless Puppet Packer provisioner configures Puppet to run on the machines
by Packer from local modules and manifest files. Modules and manifests
by Packer from local modules and manifest files. Modules and manifests
can be uploaded from your local machine to the remote machine or can simply
can be uploaded from your local machine to the remote machine or can simply
use remote paths (perhaps obtained using something like the shell provisioner).
use remote paths (perhaps obtained using something like the shell provisioner).
The shell Packer provisioner provisions machines built by Packer using shell scripts. Shell provisioning is the easiest way to get software installed and configured on a machine.
---
---
# Shell Provisioner
# Shell Provisioner
Type: `shell`
Type: `shell`
The shell provisioner provisions machines built by Packer using shell scripts.
The shell Packer provisioner provisions machines built by Packer using shell scripts.
Shell provisioning is the easiest way to get software installed and configured
Shell provisioning is the easiest way to get software installed and configured
All strings within templates are processed by a common Packer templating engine, where variables and functions can be used to modify the value of a configuration parameter at runtime.
Templates are JSON files that configure the various components of Packer in order to create one or more machine images. Templates are portable, static, and readable and writable by both humans and computers. This has the added benefit of being able to not only create and modify templates by hand, but also write scripts to dynamically create or modify templates.
The post-processor section within a template configures any post-processing that will be done to images built by the builders. Examples of post-processing would be compressing files, uploading artifacts, etc.
Within the template, the provisioners section contains an array of all the provisioners that Packer should use to install and configure software within running machines prior to turning them into machine images.
User variables allow your templates to be further configured with variables from the command-line, environmental variables, or files. This lets you parameterize your templates so that you can keep secret tokens, environment-specific data, and other types of information out of your templates. This maximizes the portablility and shareability of the template.
If you are or were a user of Veewee, then there is an official tool called veewee-to-packer that will convert your Veewee definition into an equivalent Packer template. Even if you're not a Veewee user, Veewee has a large library of templates that can be readily used with Packer by simply converting them.
With Packer installed, let's just dive right into it and build our first image. Our first image will be an Amazon EC2 AMI with Redis pre-installed. This is just an example. Packer can create images for many platforms with anything pre-installed.
That concludes the getting started guide for Packer. You should now be comfortable with basic Packer usage, should understand templates, defining builds, provisioners, etc. At this point you're ready to begin playing with and using Packer in real scenarios.
So far we've shown how Packer can automatically build an image and provision it. This on its own is already quite powerful. But Packer can do better than that. Packer can create multiple images for multiple platforms in parallel, all configured from a single template.
In the previous page of this guide, you created your first image with Packer. The image you just built, however, was basically just a repackaging of a previously existing base AMI. The real utility of Packer comes from being able to install and configure software into the images as well. This stage is also known as the _provision_ step. Packer fully supports automated provisioning in order to install software onto the machines prior to turning them into images.
Packer must first be installed on the machine you want to run it on. To make installation easy, Packer is distributed as a binary package for all supported platforms and architectures. This page will not cover how to compile Packer from source, as that is covered in the README and is only recommended for advanced users.
Welcome to the world of Packer! This introduction guide will show you what Packer is, explain why it exists, the benefits it has to offer, and how you can get started with it. If you're already familiar with Packer, the documentation provides more of a reference for all available features.
Packer can create machine images for any platform. Packer ships with support for a set of platforms, but can be extended through plugins to support any platform. This page documents the list of supported image types that Packer supports creating.
By now you should know what Packer does and what the benefits of image creation are. In this section, we'll enumerate _some_ of the use cases for Packer. Note that this is not an exhaustive list by any means. There are definitely use cases for Packer not listed here. This list is just meant to give you an idea of how Packer may improve your processes.
Pre-baked machine images have a lot of advantages, but most have been unable to benefit from them because images have been too tedious to create and manage. There were either no existing tools to automate the creation of machine images or they had too high of a learning curve. The result is that, prior to Packer, creating machine images threatened the agility of operations teams, and therefore aren't used, despite the massive benefits.
<title><%=[current_page.data.page_title,"Packer by HashiCorp"].compact.join(" - ")%></title>
<metaname="description"content="Packer is a free and open source tool for creating golden images for multiple platforms from a single source configuration."/>