LinuxCommandLibrary

crane-pull

Download container images from a registry

TLDR

Pull remote image

$ crane pull [image_name] [path/to/tarball]
copy

Preserve image reference used to pull as an annotation when used with --format=oci
$ crane pull [image_name] [path/to/tarball] --annotate-ref
copy

Path to cache image layers
$ crane pull [image_name] [path/to/tarball] [[-c|--cache_path]] [path/to/cache]
copy

Format in which to save images (default 'tarball')
$ crane pull [image_name] [path/to/tarball] [-format] [format_name]
copy

Display help
$ crane pull [[-h|--help]]
copy

SYNOPSIS

crane pull [flags] IMAGE_NAME

PARAMETERS

--platform
    Specify the target platform (OS/architecture) for the image to pull. Useful for multi-architecture images.

--digest
    Pull the image by its digest instead of a tag. Useful for ensuring immutability.

--username
    Username for registry authentication.

--password
    Password for registry authentication.

DESCRIPTION

crane pull is a command-line tool designed to efficiently fetch container images from remote registries. It allows you to download images to your local system or directly to a remote machine without needing to first download them locally. This is particularly useful in environments where direct access to the registry from the target machine is not feasible, or where network bandwidth is a constraint.

The command supports various image formats and registry types, often working seamlessly with Docker registries, Google Container Registry (GCR), and other OCI-compatible registries. crane pull prioritizes efficiency and reliability in image retrieval, optimizing the process for various network conditions and infrastructure setups. It integrates well with other container tooling and workflow automation scripts, providing a streamlined approach to managing container images in different environments.

CAVEATS

Authentication with some registries may require configuration outside of crane pull command-line options. The command's success depends heavily on network connectivity and registry availability.

AUTHENTICATION

Authentication can be performed using username and password parameters or via a preconfigured docker config file located in $HOME/.docker/config.json

HISTORY

crane initially gained popularity as a fast and lightweight alternative to docker CLI for specific container image tasks like pulling and pushing, especially in resource-constrained or automated environments. Its development has been driven by the need for efficient container image management in CI/CD pipelines and other automated workflows.

SEE ALSO

docker pull(1), skopeo copy(1)

Copied to clipboard