Build repeatable machine images with Packer

8 steps · about 1 h 23 min · Intermediate

  1. Install the Packer CLI (guide, HashiCorp, 5 min)

    Gets the build tool ready on your machine.

  2. Build your first image from an HCL template (tutorial, HashiCorp, 12 min)

    Shows sources, builds and the init-validate-build cycle.

  3. Provision the image with shell steps (tutorial, HashiCorp, 10 min)

    Bakes packages and config into the image at build time.

  4. Parameterise templates with variables (tutorial, HashiCorp, 10 min)

    Lets one template build for several environments.

  5. Build several images in parallel (tutorial, HashiCorp, 8 min)

    Shows how one run produces images for multiple targets.

  6. Tag and push images with post-processors (tutorial, HashiCorp, 8 min)

    Finishes the pipeline by publishing the result.

  7. Build an Amazon Machine Image (tutorial, HashiCorp, 15 min)

    Applies the same workflow to a real cloud image.

  8. Look up HCL template blocks and functions (reference, HashiCorp, 15 min)

    Is the reference once you move past the tutorials.