gcrane-copy
Copy container images between registries
TLDR
Copy an image from source to target
Set the maximum number of concurrent copies, defaults to 20
Whether to recurse through repositories
Display help
SYNOPSIS
gcrane copy
PARAMETERS
The fully qualified name of the source container image (e.g., gcr.io/my-project/my-image:latest).
The fully qualified name of the destination container image (e.g., docker.io/my-user/my-image:latest).
DESCRIPTION
The gcrane copy command is a utility for efficiently copying container images between different container registries. It leverages Google's crane library, providing a streamlined way to transfer image layers and metadata without requiring a local Docker daemon. This is particularly useful in environments where a Docker daemon is unavailable or undesirable. It supports various registry types, including Google Container Registry (GCR), Docker Hub, and other OCI-compliant registries. The tool prioritizes minimizing network traffic and maximizing transfer speed by reusing existing layers when possible. Users can copy images by specifying the source and destination image names, including the registry and tag. This operation effectively duplicates the image from one location to another, enabling deployment strategies, mirroring registries, or creating backups.
The command relies on the user having appropriate authentication credentials for both the source and destination registries to push and pull images. This can be achieved through environment variables or other authentication mechanisms supported by the underlying crane library. Detailed authentication documentation is found in the crane library documentaion.
CAVEATS
Requires appropriate authentication credentials for both source and destination registries. Layers are re-used when possible, but the target registry must support the specified manifest type.
The copy operation fails if the destination registry does not exist, or user lacks write permissions.
AUTHENTICATION
gcrane inherits authentication mechanisms from Google's crane. Use gcloud auth configure-docker if copying from or to GCR. For other registries, configure your environment with Docker configuration files or alternative authentication methods supported by crane.