LinuxCommandLibrary

crane-registry

Copy container images between registries

TLDR

Serve a registry implementation

$ crane registry serve
copy

Address to listen on
$ crane registry serve --address [address_name]
copy

Path to a directory where blobs will be stored
$ crane registry serve --disk [path/to/store_dir]
copy

Display help for crane registry
$ crane registry [[-h|--help]]
copy

Display help for crane registry serve
$ crane registry serve [[-h|--help]]
copy

SYNOPSIS

crane [command] [flags]

PARAMETERS

cp
    Copies a container image from one registry to another.

digest
    Prints the digest of the specified container image.

manifest
    Prints the manifest of the specified container image. The manifest describes the layers and configuration of the image.

push
    Pushes an image from the local tarball into the destination registry.

pull
    Pulls an image from the registry into the local tarball.

tag
    Tags a remote image with the given tag.

validate
    Validates an image in the registry.

ls
    Lists the tags associated with a container image in a registry.

delete
    Deletes a container image from a registry (requires registry support).

--insecure
    Allows connecting to registries via HTTP (insecure).

--platform
    Specify the target platform in the form OS/Architecture/Variant (e.g. linux/amd64).

--username
    Specifies the username for authentication.

--password
    Specifies the password for authentication.

--token
    Specifies the token for authentication.

DESCRIPTION

The crane command-line tool is designed for interacting with container registries. It simplifies tasks such as copying images between registries, listing image tags, downloading image manifests, and deleting images (if the registry supports it). Crane is particularly useful in environments where you need to manage and manipulate container images outside of a full container orchestration system like Kubernetes or Docker Swarm. Its goal is to be a lightweight, efficient, and easy-to-use tool for common registry operations.

Crane focuses on providing basic but essential functionalities related to container image management, and it does so without requiring a local Docker daemon. This makes it suitable for use on systems where Docker isn't installed or desired, or where direct access to a registry is preferred. It supports various authentication methods, including basic authentication, token-based authentication, and integration with cloud provider authentication services.

Crane is part of the Google Container Tools project.

CAVEATS

Deletion of images is dependent on the registry implementation, and not all registries support image deletion via an API.

AUTHENTICATION

Crane supports various authentication methods for accessing container registries. These methods include basic authentication (username/password), token-based authentication (using a token), and integration with cloud provider authentication services (e.g., Google Cloud's gcloud, AWS's awscli, Azure's az). The appropriate authentication method depends on the registry being accessed.

EXAMPLES

Copying an image: crane cp ubuntu:latest myregistry.example.com/ubuntu:latest
Listing tags: crane ls gcr.io/google-containers/pause

HISTORY

Crane was developed as part of the Google Container Tools project to provide a more lightweight and focused alternative to full-fledged container management tools when dealing directly with container registries. Its development focused on providing essential operations without requiring a local Docker daemon, making it suitable for automation and scripting tasks.

SEE ALSO

docker(1), skopeo(1)

Copied to clipboard