crane-export
Export container images from a registry
TLDR
Write tarball to stdout
Write tarball to file
Read image from stdin
SYNOPSIS
crane export [-f format] IMAGE DEST
PARAMETERS
-f, --format string
Format of the output: tarball (default), oci, docker.
IMAGE
The name of the container image to export (e.g., ubuntu:latest).
DEST
The destination path where the image will be saved (e.g., image.tar, oci-layout, docker-image.tar).
DESCRIPTION
The `crane export` command allows you to export a container image from a registry or local store to a local tar archive, OCI image layout, or Docker image archive. This is useful for transferring images between environments where direct network access to a registry is not available, for backing up images, or for converting between different image formats. The tool effectively pulls the image from the specified source and writes it to the destination in the specified format. It is particularly handy for working with air-gapped environments or for archiving older image versions.
The output is a fully self-contained representation of the image, including all layers and metadata, ready to be imported or loaded into another container runtime environment.
The command supports various destination types including tarballs, OCI image layouts and docker image tarballs.
CAVEATS
Ensure you have sufficient disk space to store the exported image.
When exporting to an OCI layout, the destination directory must not exist or be empty.
Requires network access to pull images from remote registries unless the image is already present in the local container runtime's image store.
FORMATS
- tarball: Creates a tar archive containing all image layers and manifests. This is the default format.
- oci: Creates an OCI image layout, which is a directory structure defined by the OCI (Open Container Initiative) standard.
- docker: Creates a Docker image archive compatible with `docker load`.
SEE ALSO
crane copy(1), docker save(1), docker load(1)