Packer (software)

Packer
Developer(s) Mitchell Hashimoto
Development status Active
Written in Go
Operating system Microsoft Windows
Mac OS X
Linux
Available in English
License Mozilla Public License Version 2.0
Website www.packer.io

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 software 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.[1]

Packer is written in Go programming language.[2]

History

Packer was first introduced by Hashicorp on June 28, 2013.[3] 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.[4] 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.[5][6] 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.[7]

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:[8]

JSON format required for packer template

      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.

      Description of what the template does.

      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.

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.[9]

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

     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.

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

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

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

     This command prints the packer version.

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

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.[11]

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.[12]

Similar software

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.[13]

See also

References

  1. "Packer introduction". Retrieved 15 September 2015.
  2. "Four years of Go - The Go Blog". Retrieved 16 September 2015.
  3. "Mithell Hashimoto Blog". Retrieved 25 September 2015.
  4. "Packer Blog". Retrieved 25 September 2015.
  5. "Chef for Containers". Retrieved April 24, 2014.
  6. "Bento". Retrieved April 24, 2015.
  7. "Why Use Packer?". Retrieved 15 September 2015.
  8. "Packer Templates Introduction". Retrieved 16 September 2015.
  9. "Packer Command Line Documentation". Retrieved 25 September 2015.
  10. "Custom Command Development - Packer by Hashicorp". Retrieved 17 September 2015.
  11. "Packer Platform Support". Retrieved 15 September 2015.
  12. "Packer Downloads". Retrieved 15 September 2015.
  13. "Convert Veewee Definitions to Packer Templates". Retrieved 15 September 2015.
This article is issued from Wikipedia - version of the 11/8/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.