»What is the HCP Packer registry?
Packer is an open source tool that enables you to create identical machine images for multiple platforms from a single source template. The most common use case is creating "golden images" that teams across an organization can use in cloud infrastructure. Consumer teams need to know which base images to use and when those base images are updated so they can build and update the downstream layers. HCP Packer registry is a service that stores metadata about your Packer images so that you can track updates, automatically use the most up-to-date base images, and automatically deploy the most up-to-date downstream images.
The HCP Packer registry bridges the gap between image factories and image deployments, allowing development and security teams to work together to create, manage, and consume images in a centralized way.
»How the Registry Works
The HCP Packer registry stores metadata about your images, including when they were created, where the image exists in the cloud, and what (if any) git commit is associated with your image build. It does not store the images themselves, since in many cases your images may already exist in cloud platforms or an artifactory-like service. The registry helps you track information about golden images, clearly designate which images are appropriate for test and production environments, and query the right images to use in both Packer and Terraform configurations.
Both image creators and image consumers can benefit from the HCP Packer registry. At a high level, here is how the process works for image creators:
Connect to the Registry: Add the
hcp_packer_registry blockto your HCL Packer templates. The
hcp_packer_registryblock lets you declare where the registry should store your image metadata, set additional labels, and add a description that will be displayed in the registry UI.
Store Image Metadata: Each time you call
packer build, Packer pushes each image artifact’s metadata to an image bucket on the registry. Image buckets contain iterations (all builds generated from the same
packer build), which store specific builds (metadata from all images produced by a single builder). This lets you find and reference specific images from a specific builder at a specific point in time.
Manage Image Use: An image channel is a human-readable name that points to a single iteration. For example, you can assign the channel "production" to an iteration with images that have passed acceptance testing and are ready to be used for production instances. This lets consumers retrieve the latest image version from their desired channel without changing their configurations.
Image consumers can reference images through both Packer templates and Terraform configuration files. They can use the HCP Packer data source and registry image channels to reference the latest versions of images to build image layers or provision infrastructure.
HCP Packer is under active development, and we are currently offering a public beta version to collect feedback and continue improving the product. We encourage you to try HCP Packer and submit your feedback.
Please submit questions, suggestions, and requests to HashiCorp Discuss.