Skip to content
Latchkey

docker save: Export Images to a Tar Archive

Serialize images (with history and tags) to a portable tar file.

docker save writes one or more images, including all layers and metadata, to a tar archive. It pairs with docker load. This page covers the flags and how it differs from docker export.

What it does

docker save serializes images - not containers - preserving layers, tags, and history. The output can be loaded on another host with docker load. Contrast with docker export, which flattens a container filesystem.

Common usage

Terminal
docker save -o myapp.tar myapp:1.2.3
docker save myapp:1.2.3 | gzip > myapp.tar.gz
docker save -o images.tar nginx:1.27 redis:7

Common errors in CI

Caching the daemon image store with docker save/load was a common CI pattern but is large and slow; prefer registry-based or BuildKit cache (--cache-to) for layer reuse. "no space left on device" can occur writing a big tar - write to a path with room and gzip the stream. Saving by image ID loses tags; save by name:tag to keep them.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →