tldr/pages/common/docker-save.md

21 lines
573 B
Markdown
Raw Normal View History

2020-11-10 19:38:14 +00:00
# docker save
> Export Docker images to archive.
2020-11-10 19:38:14 +00:00
> More information: <https://docs.docker.com/engine/reference/commandline/save/>.
- Save an image by redirecting `stdout` to a tar archive:
2020-11-10 19:38:14 +00:00
`docker save {{image}}:{{tag}} > {{path/to/file.tar}}`
- Save an image to a tar archive:
2020-11-10 19:38:14 +00:00
`docker save --output {{path/to/file.tar}} {{image}}:{{tag}}`
- Save all tags of the image:
`docker save --output {{path/to/file.tar}} {{image_name}}`
- Cherry-pick particular tags of an image to save:
`docker save --output {{path/to/file.tar}} {{image_name:tag1 image_name:tag2 ...}}`