github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/website/source/docs/extend/plugins.html.markdown (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Packer Plugins - Extend Packer"
     4  ---
     5  
     6  # Packer Plugins
     7  
     8  Plugins allow new functionality to be added to Packer without
     9  modifying the core source code. Packer plugins are able to add new
    10  commands, builders, provisioners, hooks, and more. In fact, much of Packer
    11  itself is implemented by writing plugins that are simply distributed with
    12  Packer. For example, all the commands, builders, provisioners, and more
    13  that ship with Packer are implemented as Plugins that are simply hardcoded
    14  to load with Packer.
    15  
    16  This page will cover how to install and use plugins. If you're interested
    17  in developing plugins, the documentation for that is available the
    18  [developing plugins](/docs/extend/developing-plugins.html) page.
    19  
    20  Because Packer is so young, there is no official listing of available
    21  Packer plugins. Plugins are best found via Google. Typically, searching
    22  "packer plugin _x_" will find what you're looking for if it exists. As
    23  Packer gets older, an official plugin directory is planned.
    24  
    25  ## How Plugins Work
    26  
    27  Packer plugins are completely separate, standalone applications that the
    28  core of Packer starts and communicates with.
    29  
    30  These plugin applications aren't meant to be run manually. Instead, Packer core executes
    31  these plugin applications in a certain way and communicates with them.
    32  For example, the VMware builder is actually a standalone binary named
    33  `packer-builder-vmware`. The next time you run a Packer build, look at
    34  your process list and you should see a handful of `packer-` prefixed
    35  applications running.
    36  
    37  ## Installing Plugins
    38  
    39  The easiest way to install a plugin is to name it correctly, then place
    40  it in the proper directory. To name a plugin correctly, make sure the
    41  binary is named `packer-TYPE-NAME`. For example, `packer-builder-amazon-ebs`
    42  for a "builder" type plugin named "amazon-ebs". Valid types for plugins
    43  are down this page more.
    44  
    45  Once the plugin is named properly, Packer automatically discovers plugins
    46  in the following directories in the given order. If a conflicting plugin is
    47  found later, it will take precedence over one found earlier.
    48  
    49    1. The directory where `packer` is, or the executable directory.
    50  
    51    2. `~/.packer.d/plugins` on Unix systems or `%APPDATA%/packer.d` on
    52       Windows.
    53  
    54    3. The current working directory.
    55  
    56  The valid types for plugins are:
    57  
    58  * `builder` - Plugins responsible for building images for a specific platform.
    59  
    60  * `command` - A CLI sub-command for `packer`.
    61  
    62  * `post-processor` - A post-processor responsible for taking an artifact
    63      from a builder and turning it into something else.
    64  
    65  * `provisioner` - A provisioner to install software on images created by
    66      a builder.