LinuxCommandLibrary

gcrane

Copy container images to/from registries

TLDR

Execute a gcrane subcommand

$ gcrane [subcommand]
copy

Allow pushing non-distributable (foreign) layers
$ gcrane --allow-nondistributable-artifacts [subcommand]
copy

Allow image references to be fetched without TLS
$ gcrane --insecure [subcommand]
copy

Specify the platform in the form os/arch{{/variant}}{{:osversion}} (e.g. linux/amd64). (default all)
$ gcrane --platform [platform] [subcommand]
copy

Enable debug logs
$ gcrane [[-v|--verbose]] [subcommand]
copy

Display help
$ gcrane [[-h|--help]]
copy

SYNOPSIS

gcrane [command] [flags]

PARAMETERS

--blob-cache-dir string
    Directory in which to cache blobs (defaults to $HOME/.config/gcrane/blobs)

--debug
    Enable debug logs.

--disable-compression
    Disable compression when pushing layers.

--google-default-region string
    The default Google Cloud region to use.

--max-concurrency int
    Maximum number of concurrent operations (default 5)

--platform string
    The platform to use when resolving image references (format: os/arch[/variant])

--user-agent string
    User agent string to use for requests

--insecure
    Allow insecure connections (not recommended)

DESCRIPTION

gcrane is a command-line tool designed to simplify interacting with Google Container Registry (GCR) and Artifact Registry.

It provides functionality similar to docker pull, docker push, and docker tag but is specifically tailored for Google's container registries. gcrane allows you to copy images between registries (including local Docker daemons), delete images, and list repositories. It simplifies image management tasks by providing streamlined authentication and authorization mechanisms for Google Cloud. This is especially helpful when working in environments where you need to interact with container images stored within Google Cloud without the overhead of configuring the Docker CLI or setting up complex authentication schemes. Gcrane provides several advantages over the standard docker CLI including automatic authentication and optimized data transfer, making it more suitable for use within Google Cloud environments.

AUTHENTICATION

gcrane typically authenticates using the Google Cloud SDK's credentials. If the SDK is configured correctly, gcrane can automatically authenticate without requiring explicit login commands. It supports various authentication methods including application default credentials, service account credentials, and user account credentials.

IMAGE COPYING

A primary use case for gcrane is copying images between different container registries or between a local Docker daemon and a GCR/Artifact Registry. It can be used to migrate images between environments or to create backups of images. Supports copy, push, pull commands.

HISTORY

gcrane was developed by Google as a specialized tool for interacting with their container registries. Its development was driven by the need for a more efficient and streamlined way to manage container images within the Google Cloud ecosystem. Unlike the more generic crane tool which works with several registries, gcrane is designed specifically to work with Google Container Registry and Artifact Registry.

SEE ALSO

docker(1), crane(1)

Copied to clipboard