LinuxCommandLibrary

crane-config

Configure crane, an OCI registry client

TLDR

Get the configuration of an image

$ crane config [image_name]
copy

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

SYNOPSIS

crane config [-f, --format tmpl] [-p, --platform platformimage-ref

PARAMETERS

-f, --format string
    Format JSON output using Go template syntax

-p, --platform string
    Fetch config for specific platform (e.g., linux/amd64) instead of index default

DESCRIPTION

crane config is a subcommand of the crane CLI tool from Google's go-containerregistry project. It fetches and prints the JSON configuration blob for a container image from a registry without downloading layers.

The config contains key metadata: created, architecture, os, config (with Env, Cmd, Entrypoint, WorkingDir, etc.), rootfs details, and labels.

Ideal for quick inspection, CI/CD pipelines, or verifying multi-platform images. Specify --platform for non-default architectures like linux/arm64. Outputs raw JSON or formatted via Go templates. Requires registry access; supports insecure mode globally.

CAVEATS

Network access to registry required; no local image support; global flags like --insecure may apply.

EXAMPLE

crane config alpine:3.18
crane config -p linux/arm64 alpine:3.18
crane config -f '{{jsonPretty .Config}}' busybox

HISTORY

Introduced in go-containerregistry by Google (circa 2019); evolved for efficient, layer-free image ops in Kubernetes ecosystem.

SEE ALSO

crane(1), skopeo-inspect(1), docker-inspect(1)

Copied to clipboard