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.tarIn 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
docker load Command ReferenceReference for docker load in CI: import images from a tar archive produced by docker save, restoring them int…
docker images Command ReferenceReference for docker images in CI: list local images with --filter, --format, and -q to inspect or script ove…
docker push Command ReferenceReference for docker push in CI: publish a tagged image or all tags to a registry, with notes on authenticati…