crane-tag
Copy container images between registries
TLDR
Tag remote image
Display help
SYNOPSIS
crane tag source_image destination_image
PARAMETERS
source_image
The fully qualified name of the source OCI image (e.g., `docker.io/library/ubuntu:latest`).
destination_image
The fully qualified name of the destination OCI image (e.g., `myregistry.com/mynamespace/ubuntu:staging`).
DESCRIPTION
The `crane tag` command in the `crane` tool simplifies the process of copying OCI (Open Container Initiative) image tags between container registries. It facilitates mirroring container images or promoting images between development, staging, and production environments. It handles the complexities of interacting with container registries, allowing users to easily replicate images by specifying the source and destination registry and tags. `crane tag` copies the image manifest and layers, effectively creating a new tag for the same image content in the target registry. This is useful for updating tags, migrating images, or making images available from multiple registries. The command improves the agility and scalability of container deployments.
CAVEATS
Requires appropriate authentication and authorization to both source and destination container registries.
Ensure that the destination registry exists, crane tag command does not create it.
AUTHENTICATION
Crane leverages Docker's configuration (`~/.docker/config.json`) for authentication. Ensure you are logged in to both source and destination registries using `docker login` or equivalent tools before running `crane tag`.
IMAGE DIGESTS
Although the command focuses on tagging, using image digests instead of tags in the *source_image* parameter is a good practice for immutability.
ERROR HANDLING
`crane tag` reports errors clearly if it encounters permission issues or problems connecting to the registries. Consult the error messages for debugging.
HISTORY
Crane is a relatively newer tool compared to Docker itself. Its development focuses on providing a streamlined interface for OCI image management. `crane tag` emerged as a necessity for efficiently replicating and promoting container images within complex deployment workflows.
SEE ALSO
crane copy(1), crane push(1), crane pull(1)