Packer - Build d'images (VMs, containers, ISOs)
Find a file
Lucas Bajolet 548893bbee build: don't suggest lack of HCP support on fail
When running a build with HCP Packer enabled, Packer attempts to push
the build status to HCP.
If the build fails, we update the status to BUILD_FAILED, and that's the
end of it.
If however the build succeeds, Packer attempts to get the HCP artifact
from the builder, which will only succeed if the builder supports it.
Otherwise, we'll get either nil, or an artifact type that is not
compatible with what is expected for HCP support.

When either of those happens, we warn that the builder may not support
HCP Packer at all, so users are aware of the problem.

However, when the error was introduced, it only looked at the fact that
an error was produced, independently of the type of error. This caused
legitimate errors while building to be reported as potential
incompatibility between the builder and HCP, which was confusing to
users.

This commit changes this by introducing a new error type, only produced
when the artifact either is nil, or failed to be deserialised into a HCP
artifact, which lets us produce the incompatibility warning with more
accuracy.
2024-02-13 14:47:06 -05:00
.github Remove external Plugins from left navbar 2024-02-08 09:19:54 -05:00
.release [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
acctest Update Acceptance Test to include BuilderSet 2023-11-22 21:36:01 -05:00
builder chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
cmd chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
command build: don't suggest lack of HCP support on fail 2024-02-13 14:47:06 -05:00
contrib/zsh-completion Update fix command autocomplete to work for JSON template files only (#12366) 2023-04-14 13:00:24 -04:00
datasource Migrate HCP Packer to API V2 and new nomenclature changes (#12794) 2024-01-24 13:17:35 -05:00
examples Fixes typos in docs (#11322) 2021-10-11 10:19:49 +02:00
fix [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
hcl2template hcl2template: check bucket name at parse-time 2024-01-31 09:56:57 -05:00
helper [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
internal/hcp build: don't suggest lack of HCP support on fail 2024-02-13 14:47:06 -05:00
packer packer: remove single-component plugins 2024-01-12 09:06:22 -05:00
post-processor Bump github.com/pierrec/lz4 to v4.1.18 2023-09-26 12:16:40 -04:00
provisioner chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
scripts Remove dangling upgrade external plugins script 2023-11-10 14:20:35 -05:00
test Extract ansible plugins (#10912) 2021-04-16 10:31:09 -04:00
version Revert "Bumped product version to 1.12.0." 2023-11-10 16:32:19 -05:00
website Remove external Plugins from left navbar 2024-02-08 09:19:54 -05:00
.copywrite.hcl update year in license files 2023-12-06 12:43:42 -08:00
.gitattributes HCL2: add templatefile function (#10776) 2021-03-23 12:02:05 +01:00
.gitignore Remove the vendor dir (#10916) 2021-04-21 10:52:55 +02:00
.go-version Bump Go version to 1.20.12 2024-01-08 11:11:39 -05:00
.golangci.yml [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
background_check.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
background_check_openbsd.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
CHANGELOG.md Update CHANGELOG 2024-01-30 05:27:00 -05:00
checkpoint.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
CODEOWNERS Remove release-engineering as codeowners 2023-11-22 10:01:34 -05:00
commands.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
config.go Remove functions for detecting plugin usage 2023-10-24 06:00:42 -04:00
config_test.go chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
Dockerfile [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
go Bump Go tooling version to 1.20.8 2023-10-03 10:32:42 -04:00
go.mod build(deps): bump github.com/hashicorp/hcp-sdk-go from 0.82.0 to 0.83.0 (#12827) 2024-02-08 12:13:09 -05:00
go.sum build(deps): bump github.com/hashicorp/hcp-sdk-go from 0.82.0 to 0.83.0 (#12827) 2024-02-08 12:13:09 -05:00
LICENSE update year in license files 2023-12-06 12:43:42 -08:00
log.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
main.go chore: remove refs to deprecated io/ioutil 2023-09-26 11:13:31 -04:00
main_test.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
Makefile Makefile: only build dev version of binary/docker 2023-08-04 13:30:41 -04:00
panic.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
README.md Update README 2023-10-26 15:03:55 -04:00
tty.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
tty_solaris.go [COMPLIANCE] License changes (#12568) 2023-08-10 15:53:29 -07:00
Vagrantfile vagrantfile: add support for docker provider 2018-10-31 16:58:06 +03:00

Packer

License: BUSL-1.1 Build Status Discuss

HashiCorp Packer logo

Packer is a tool for building identical machine images for multiple platforms from a single source configuration.

Packer is lightweight, runs on every major operating system, and is highly performant, creating machine images for multiple platforms in parallel. Packer supports various platforms through external plugin integrations, the full list of which can be found at https://developer.hashicorp.com/packer/integrations.

The images that Packer creates can easily be turned into Vagrant boxes.

Quick Start

Packer

There is a great introduction and getting started guide for building a Docker image on your local machine without using any paid cloud resources.

Alternatively, you can refer to getting started with AWS to learn how to build a machine image for an external cloud provider.

HCP Packer

HCP Packer registry stores Packer image metadata, enabling you to track your image lifecycle.

To get started with building an AWS machine image to HCP Packer for referencing in Terraform refer to the collection of HCP Packer Tutorials.

Documentation

Comprehensive documentation is viewable on the Packer website at https://developer.hashicorp.com/packer/docs.

Contributing to Packer

See CONTRIBUTING.md for best practices and instructions on setting up your development environment to work on Packer.

Unmaintained Plugins

As contributors' circumstances change, development on a community maintained plugin can slow. When this happens, HashiCorp may use GitHub's option to archive the plugins repository, to clearly signal the plugin's status to users.

What does unmaintained mean?

  1. The code repository and all commit history will still be available.
  2. Documentation will remain on the Packer website.
  3. Issues and pull requests are monitored as a best effort.
  4. No active development will be performed by HashiCorp.

If you are interested in maintaining an unmaintained or archived plugin, please reach out to us at packer@hashicorp.com.