Skip to content
Latchkey

docker save Command Reference

Save images to a tar archive.

docker save serializes one or more images, including all layers and metadata, into a tar stream. In CI it pairs with docker load to move a built image between jobs (via the artifact store) without a registry round trip.

Common flags

  • -o, --output - write to a file instead of stdout
  • Positional image references (one or more) to include in the archive

Example

shell
docker save -o image.tar myorg/app:${{ github.sha }}
gzip image.tar

In CI

Save the image to a tar, upload it as a job artifact, then docker load it in a downstream job. This avoids pushing intermediate images to a registry. Gzip the tar to cut artifact upload time and storage.

Key takeaways

  • save serializes full images (all layers) to a portable tar.
  • Pair with docker load to share images across jobs without a registry.
  • Gzip the archive to reduce artifact size and transfer time.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →