home / cloud / packer

Packer

Official · HashiCorp
16k

Official HashiCorp CLI for validating templates, installing plugins, and building machine images across cloud and virtualization platforms.

$brew tap hashicorp/tap && brew install hashicorp/tap/packer
Language
Go
Stars
15,621
Category
Cloud & Storage
Agent
AI Analysis

Packer is HashiCorp's CLI for turning HCL templates into repeatable machine images and other build artifacts across cloud and virtualization platforms. It also handles template inspection, validation, formatting, and plugin installation around that build workflow.

What It Enables
  • Define one image pipeline in HCL, then build AMIs, VM images, and other platform-specific artifacts from the same template.
  • Inspect, validate, and format Packer templates before a build so bad variables, missing plugins, and config errors fail earlier.
  • Install and pin required plugins so image-build workflows can be reproduced across CI runners and operator machines.
Agent Fit
  • Commands such as init, validate, inspect, and build are non-interactive by default, exit-code driven, and fit inspect/change/verify loops in CI.
  • -machine-readable gives parseable stdout, but it is timestamped comma-delimited text rather than JSON, so follow-up parsing is more brittle than JSON-native CLIs.
  • Best fit when an agent is managing an existing image pipeline with known credentials, plugin requirements, and template inputs.
Caveats
  • Real builds depend on cloud or hypervisor credentials, can take a long time, and may create billable infrastructure.
  • Some modes are human-oriented, such as -debug pauses and -on-error=ask, so unattended runs should pin non-interactive behavior explicitly.