# docker save Command Reference

> Reference for docker save in CI: export one or more images to a tar archive with -o, for passing images between jobs as artifacts in pipelines.

Source: https://latchkey.dev/learn/command-reference/docker-save-command-reference  
Updated: 2026-06-26

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.

## FAQ

### docker save Command Reference?

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.

### 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.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
