Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
41 changes: 41 additions & 0 deletions content/packer/v1.10.x/content/community-plugins.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
page_title: Community vs HashiCorp Maintained Plugins
description: Packer maintains these core plugins.
---

# HashiCorp Maintained Plugins

The following plugins (i.e. Builders, Provisioners, and Post-Processors) are
maintained by HashiCorp. Any plugins not on this list are maintained by the
community, and not actively contributed to by HashiCorp, although they are
still distributed with Packer. If you are interested in seeing features or
bugfixes to these plugins, please consider making a pull request, or asking the
HashiCorp maintainers for advice on how to get started contributing.

## Builders

- Amazon EC2
- Azure
- Docker
- Google Cloud
- VMware
- VirtualBox

## Provisioners

- File
- InSpec
- PowerShell
- Shell
- Windows Restart
- Windows Shell

## Post-Processors

- Amazon Import
- Artifice
- Docker
- Local Shell
- Manifest
- Vagrant
- Vagrant Cloud
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: |
Community-maintained builders are not part of the core Packer binary, but
can run alongside Packer with minimal extra effort.
page_title: Community - Builders
---

# Community Builders

The following builders are developed and maintained by various members of the
Packer community, not by HashiCorp. For more information on how to use community
builders, see our docs on [extending Packer](/packer/docs/plugins/creation).

@include 'builders/community_builders.mdx'
15 changes: 15 additions & 0 deletions content/packer/v1.10.x/content/docs/builders/custom.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
description: |
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.
page_title: Custom - Builders
---

# Custom Builder

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](/packer/docs/plugins/creation/custom-builders) page of the Packer plugin
section.
76 changes: 76 additions & 0 deletions content/packer/v1.10.x/content/docs/builders/file.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
description: |
The file Packer builder is not really a builder, it just creates an artifact
from a file. It can be used to debug post-processors without incurring high
wait times.
page_title: File - Builders
---

<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>

# File Builder

Type: `file`
Artifact BuilderId: `packer.file`

The `file` Packer builder is not really a builder, it just creates an artifact
from a file. It can be used to debug post-processors without incurring high
wait times.

## Basic Example

Below is a fully functioning example. It create a file at `target` with the
specified `content`.

<Tabs>
<Tab heading="JSON">

```json
{
"type": "file",
"content": "Lorem ipsum dolor sit amet",
"target": "dummy_artifact"
}
```

</Tab>
<Tab heading="HCL2">

```hcl
source "file" "basic-example" {
content = "Lorem ipsum dolor sit amet"
target = "dummy_artifact"
}

build {
sources = ["sources.file.basic-example"]
}
```

</Tab>
</Tabs>

## Configuration Reference

Configuration options are organized below into two categories: required and
optional. Within each category, the available options are alphabetized and
described.

Any [communicator](/packer/docs/templates/legacy_json_templates/communicator) defined is ignored.

### Required:

- `target` (string) - The path for the artifact file that will be created. If
the path contains directories that don't exist, Packer will create them, too.

### Optional:

You can only define one of `source` or `content`. If none of them is defined
the artifact will be empty.

- `source` (string) - The path for a file which will be copied as the
artifact.

- `content` (string) - The content that will be put into the artifact.
22 changes: 22 additions & 0 deletions content/packer/v1.10.x/content/docs/builders/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
description: |
Builders are responsible for creating machines and generating images from them
for various platforms.
page_title: Builders
---

# Builders

Builders create machines and generate images from those machines for various platforms. Packer also has some builders that perform helper tasks, like running provisioners.

Packer has the following types of builders:

- [Plugin](/packer/plugins): Each plugin has its own associated set of builders. For example, there are separate builders for EC2, VMware, VirtualBox, etc.
- [File](/packer/docs/builders/file): The `file` builder creates an artifact from a file.
- [Null](/packer/docs/builders/null): The `null` builder sets up an SSH connection and runs the provisioners.
- [Custom](/packer/docs/plugins/creation/custom-builders): You can write new builders for new or existing platforms.
- [Community-Supported](/packer/docs/builders/community-supported): The Packer community develops and maintains builders for several additional platforms.

Refer to the [`source`](/packer/docs/templates/hcl_templates/blocks/source) block documentation to learn more about configuring builders in the Packer templating language.


61 changes: 61 additions & 0 deletions content/packer/v1.10.x/content/docs/builders/null.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
description: |
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.
page_title: Null - Builders
---

<BadgesHeader>
<PluginBadge type="official" />
</BadgesHeader>

# Null Builder

Type: `null`

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.

## Basic Example

Below is a fully functioning example. It doesn't do anything useful, since no
provisioners are defined, but it will connect to the specified host via ssh.

<Tabs>
<Tab heading="JSON">

```json
{
"type": "null",
"ssh_host": "127.0.0.1",
"ssh_username": "foo",
"ssh_password": "bar"
}
```

</Tab>
<Tab heading="HCL2">

```hcl
source "null" "basic-example" {
ssh_host = "127.0.0.1"
ssh_username = "foo"
ssh_password = "bar"
}

build {
sources = ["sources.null.basic-example"]
}
```

</Tab>
</Tabs>

## Configuration Reference

The null builder has no configuration parameters other than the
[communicator](/packer/docs/templates/legacy_json_templates/communicator) settings.
68 changes: 68 additions & 0 deletions content/packer/v1.10.x/content/docs/commands/build.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
description: |
The `packer build` 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.
page_title: packer build - Commands
---

# `build` Command

The `packer build` 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.

## Options

- `-color=false` - Disables colorized output. Enabled by default.

- `-debug` - Disables parallelization and enables debug mode. Debug mode
flags the builders that they should output debugging information. The exact
behavior of debug mode is left to the builder. In general, builders usually
will stop between each step, waiting for keyboard input before continuing.
This will allow the user to inspect state and so on.

`@include 'commands/except.mdx'`

- `-force` - Forces a builder to run when artifacts from a previous build
prevent a build from running. The exact behavior of a forced build is left
to the builder. In general, a builder supporting the forced build will
remove the artifacts from the previous build. This will allow the user to
repeat a build without having to manually clean these artifacts beforehand.

- `-on-error=cleanup` (default), `-on-error=abort`, `-on-error=ask`, `-on-error=run-cleanup-provisioner` -
Selects what to do when the build fails during provisioning. Please note that
this only affects the build during the provisioner run, not during the
post-processor run, because it is related to whether or not to keep the
instance running and related artifacts like generated SSH keys on the system
when a provisioner fails.

- `cleanup` cleans up after the previous steps, deleting temporary files and virtual machines.
- `abort` exits without any cleanup, which might require the next build to use `-force`.
- `ask` presents a prompt and waits for you to decide to clean up, abort, or retry
the failed step.
- `run-cleanup-provisioner` aborts and exits without any cleanup besides
the [error-cleanup-provisioner](/packer/docs/templates/legacy_json_templates/provisioners#on-error-provisioner) if one is defined.

`@include 'commands/only.mdx'`

- `-parallel-builds=N` - Limit the number of builds to run in parallel, 0
means no limit (defaults to 0).

- `-timestamp-ui` - Enable prefixing of each ui output with an RFC3339
timestamp.

- `-var` - Set a variable in your Packer template. This option can be used
multiple times. This is useful for setting version numbers for your build.

- `-var-file` - Set template variables from a file.

- `-warn-on-undeclared-var` - Setting this flag will yield a warning for each assignment within
a variable definitions file (*.pkrvars.hcl | *.pkrvars.json) that does not have an accompanying
variable block. This can occur when using a var-file that contains a large amount of unused variables
for a given HCL2 template. For HCL2 template builds defining a value for a variable in a var-file is
not enough on its own for Packer to function, as there also needs to be a variable block definition in
the template files `pkr.hcl` for the variable. By default `packer build` will not warn when a var-file
contains one or more undeclared variables.
Loading
Loading