Each HCP Packer organization has one associated Packer registry that can contain one or more image buckets. Image buckets are repositories that store information about each artifact from a configured Packer template.
Image buckets do not store image artifacts themselves, so you must continue to store images in cloud platforms or other services. Instead, image buckets contain image metadata that include a reference to the image location and optional custom metadata that help consumers better identify the image’s contents and purpose.
- Iteration: This is an immutable record generated by
packer build. Iterations allow you to track revisions and revocations of images over time. Each complete iteration has at least one build, but iterations may have many builds depending on how you configured sources in your template.
- Build: This is the metadata from all images produced by a single builder.
Because of this, image buckets are cloud agnostic and can contain image metadata for machine images or containers from multiple providers. For example, a golden image for Amazon Web Services (AWS) may exist in multiple regions, or you may have an equivalent Azure image containing the same software. If you define these images in the same Packer template, the registry stores their metadata in the same image bucket.
The example below shows an iteration with builds from two different cloud providers.
»View Image Buckets
To view an image bucket in your organization:
Click Packer in the sidebar. The HCP Packer page appears, listing all of the image buckets in the organization.
Click an image bucket ID. The image bucket Overview page appears, showing the bucket description, the image ID from the latest iteration, and any custom labels. Click Iterations in the sidebar to find details about each iteration and click Channels to find details about associated image channels.
»Create Image Buckets
The registry creates image buckets automatically the first time you call
packer build on a configured template. To create a new image bucket from an existing Packer template, change the image bucket’s name in the
hcp_packer_registry block. The next time you build the template, the registry will create a new image bucket with the new name for that template.
»Edit Image Buckets
To edit image bucket metadata, change the values in the
hcp_packer_registry template block. The next time you build the template, the new values will overwrite the old values on the registry. Prior iterations that already exist in a bucket are immutable, so they will retain their metadata even when you update your template file. If you change the image bucket’s name, the registry creates a new image bucket with the new name for your template and stores all future image metadata in the new bucket. It does not delete the old bucket.
Note: The registry does not update image metadata when you manually rename, delete, or move an image artifact.
»Delete Image Buckets
Warning: Deletion is permanent. Once you delete an image bucket, you cannot recover its data.
To delete an image bucket:
- Go to the HCP Packer homepage and click the ellipses (...) to the right of the image bucket you want to delete. The Delete image bucket? box appears.
- Click Delete image bucket.
The bucket and all of its data have been permanently removed from the HCP Packer registry.