crane-manifest
View content manifest for container images
TLDR
Get the manifest
Display help
SYNOPSIS
crane manifest COMMAND [OPTIONS] ARGUMENTS
Available Commands:
create REFERENCE IMAGE... [OPTIONS]
add MANIFEST_LIST_REF IMAGE_REF [OPTIONS]
rm MANIFEST_LIST_REF IMAGE_REF [OPTIONS]
list REFERENCE [OPTIONS]
annotate MANIFEST_LIST_REF IMAGE_DIGEST [OPTIONS]
PARAMETERS
--output, -o
Specify a local file path to write the manifest list to, instead of pushing it to a registry. Useful for inspection or further processing.
--platform
Specify the target platform (e.g., 'linux/amd64', 'windows/arm64') for an image when adding it to or annotating it within a manifest list. Used to explicitly declare the architecture and OS of an entry.
--annotation
Add one or more key-value annotations to an image entry in a manifest list. This option can be used multiple times to add multiple annotations. Common annotations include 'org.opencontainers.image.url', 'org.opencontainers.image.source', etc.
--json
For the 'list' subcommand, output the manifest list contents in JSON format, facilitating programmatic parsing and scripting.
--tag
For the 'create' subcommand, specify the tag name for the newly created manifest list in the registry.
--digest-file
Write the digest of the pushed manifest list to the specified file. Useful for capturing the exact reference for later use.
DESCRIPTION
crane-manifest is a subcommand of the crane tool, part of the go-containerregistry project. It is specifically designed to interact with and manipulate OCI image indexes (also known as Docker manifest lists or multi-architecture manifests). These lists are crucial for distributing container images that support multiple CPU architectures (e.g., amd64, arm64), operating systems (e.g., Linux, Windows), or other variants under a single tag.
The command allows users to create new manifest lists from a set of existing images, add or remove images from an existing list, inspect the contents of a list, and annotate individual image entries within a list with platform-specific metadata or other properties. It provides a lightweight, daemon-less way to manage these complex image structures directly with container registries, making it a valuable tool for CI/CD pipelines, cross-platform image builds, and general registry administration.
CAVEATS
Using crane-manifest requires direct access to and appropriate authentication for the target container registry. As it directly manipulates registry contents, caution is advised, especially in production environments. A basic understanding of OCI image index and Docker V2 Schema 2 manifest list specifications is beneficial for advanced usage and troubleshooting.
KEY USE CASES
Key Use Cases:
crane-manifest is invaluable for:
- Creating and managing multi-architecture container images (e.g., providing a single tag that resolves to different images for linux/amd64, linux/arm64, windows/amd64, etc.).
- Automating the promotion and deployment of container images in continuous integration and continuous delivery (CI/CD) workflows.
- Inspecting and verifying the structure and contents of manifest lists directly within container registries.
- Facilitating the creation and management of custom or private image variants under a unified registry entry.
SCRIPTING AND AUTOMATION
Due to its command-line interface and predictable output, crane-manifest is highly amenable to scripting. Its daemon-less operation makes it an ideal tool for integration into automated build systems, shell scripts, and other orchestration environments where direct registry interaction is required without the overhead of a full container engine.
HISTORY
The crane tool, and consequently crane-manifest, is an integral part of the go-containerregistry project, primarily developed by Google. This project was initiated to provide robust Go libraries and command-line utilities for seamless interaction with OCI (Open Container Initiative) registries and container images, without the necessity of a Docker daemon. It gained rapid adoption due to its efficiency, simplicity, and excellent suitability for integration into CI/CD pipelines and automation scripts, offering a lightweight yet powerful alternative for managing container images compared to more traditional tools. crane-manifest specifically addresses the critical and growing need for comprehensive multi-architecture image support within this ecosystem.