$linuxjunkies
>

crane(1)

Crane is a tool for reading, writing, and manipulating container images without requiring a container runtime.

UbuntuDebianFedoraArch

Synopsis

crane [COMMAND] [OPTIONS] [ARGS]

Description

Crane is a CLI tool for interacting with remote container images and registries. It allows you to inspect, copy, and modify container images directly without needing Docker or another container runtime installed.

Common operations include pulling image metadata, examining layers, copying images between registries, and authenticating with private registries. Crane works with OCI-compliant registries like Docker Hub, Google Container Registry, and private registries.

Common options

FlagWhat it does
--help, -hshow help message for a command
--insecureallow HTTP (non-HTTPS) registry connections
--platformspecify platform (e.g., linux/amd64, linux/arm64)
--allow-insecure-registriesallow insecure registry connections without SSL verification
-v, --verboseenable verbose/debug output

Examples

pull a container image from a registry and save it as a tar file

crane pull gcr.io/myproject/myimage:latest image.tar

push a tar image to a remote registry

crane push image.tar myregistry.com/myrepo/myimage:v1.0

get the digest (SHA256 hash) of an image in a registry

crane digest gcr.io/myproject/myimage:latest

display the image configuration (metadata) in JSON format

crane config gcr.io/myproject/myimage:latest

list all image tags available in a registry repository

crane ls gcr.io/myproject

copy an image directly from one registry to another

crane copy gcr.io/source/image:latest myregistry.com/dest/image:latest

retrieve and display the manifest of an image

crane manifest docker.io/library/ubuntu:latest

download a specific image layer blob by its digest

crane blob gcr.io/myproject/myimage@sha256:abc123... > layer.tar.gz

Related commands