User:Garadhy/packer sandbox

Packer is free and open-source software for creating identical machine images or containers for multiple platforms from a single source configuration. It is used primarily to automate the creation of machine images which have a particular operating system and pre-installed softwares in it. It was written by Mitchell Hashimoto and became one of the products in his company Hashicorp's software toolkits as open-source proprietary-managed software. Packer can be used with Vagrant or independently. Packer can also be used with configuration management tools such as Chef and Puppet. However, it does not serve as a substitute for these tools.

Packer is written in Go programming language.

History
Packer was first introduced by Hashicorp on June 28, 2013. In April 2015, Hashicorp announced Packer integration with Atlas. This allowed remotely managing automated packer builds. After two months, in June 2015, Hashicorp release 0.8 version of Packer. This was the largest release of Packer in terms of number of features. Packer version 0.8 facilitated creating Windows images on AWS, and obviated the need of having SSH server installed. Instead, WinRM support was introduced.

Applications
Packer can act as a component in a continuous integration workflow. The images that Packer creates can easily be turned into Vagrant boxes. Any updates to an image become available to the users through Vagrant cloud (a cloud service also from Hashicorp) or Atlas. The users can then update their copies of the image by running certain Vagrant commands. The Hashicorp Terraform system deployment product can use Packer as a container, and the Hashicorp Atlas workflow tool includes Vagrant, Packer, Serf, and Terraform as component tools.

Chef can use Packer for container creation via the Bento toolkit. As Packer makes it possible to produce identical images on multiple platforms, it is possible to have testing, development and production in different platforms keeping the same machine image.

Usage
Packer takes a configuration template and produces machine image as per instructions in the template. Templates are usually JSON files and can contain following sections:

This section holds an array of objects that Packer should use to generate different machine images. Each builder object generates an image for a specific platform. By default, Packer comes with builders for several platforms as mentioned below in platform support.
 * builders

Description of what the template does.
 * description

Minimum Packer version required to parse the template to ensure that proper versions of Packer are used with the template. Packer supports backward compatibility using the fix command. Defines the various post-processing steps to take with the built images. For instance, the built image can be converted to Vagrant box format. To install additional software beyond the base operating system software. Typical example of provisioners can be Shell. Defines user variables contained in the template. These variables contain values passed from command line and can be used multiple times in a single template.
 * min_packer_version
 * post-processors
 * provisioners
 * variables

While other fields are optional, builders is a mandatory section in a template.

Basic Commands
Below commands are available as of packer version 0.8.6.

This command will build the image according to the template provided.
 * Build

This command is used to update old packer templates to new format. Typical scenario where it can be used is when newer version of packer expects different template format than the previous version of the software.
 * Fix

This command lists out the basic components in the template such as variables, builders and post-processors, without going into details.
 * Inspect

This command is used to push the packer images to remote build repository. Currently the only remote build service supported is Atlas by Hashicorp.
 * Push

This command is used to ensure the template has correct syntax. It can be used before building image to catch early issues in template.
 * Validate

This command prints the packer version.
 * Version

Packer also supports custom command development which allows one to add new commands to the Packer.

Platform Support
Packer can create images for multiple platforms including Amazon EC2, DigitalOcean, Docker, Google Compute Engine, OpenStack, Parallels, QEMU, VirtualBox, VMware(OVF) and is extensible to more platforms through plugins, according to platform support list.

Operating System Support
Packer can be installed on almost all major operating systems and is distributed as a binary package for all supported platforms and architectures. Binaries can be downloaded for 32 bit and 64 bit versions of FreeBSD, Linux, Mac OS X, OpenBSD and Windows.

Similar Softwares
Veewee is also an open source tool as Packer and also used to create machine images. Packer also supports converting of Veewee template to equivalent Packer template so as to make it simple for existing Veewee users to use Packer.