Skip to content

Instantly share code, notes, and snippets.

@pvgomes
Created November 19, 2014 11:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvgomes/9f19e80454bb56565ee9 to your computer and use it in GitHub Desktop.
Save pvgomes/9f19e80454bb56565ee9 to your computer and use it in GitHub Desktop.
Difference between save and export
As I described in my last post (http://tuhrig.de/difference-between-save-and-export-in-docker), there are two ways to persist a Docker images or container:
A Docker image can be saved to a tarball and loaded back again. This will preserve the history of the image.
# save the image to a tarball
docker save <IMAGE NAME> > /home/save.tar
# load it back
docker load < /home/save.tar
A Docker container can be exported to a tarball and imported back again. This will not preserve the history of the container.
# export the container to a tarball
docker export <CONTAINER ID> > /home/export.tar
# import it back
cat /home/export.tar | docker import - some-name:latest
@ackris
Copy link

ackris commented Jul 28, 2017

Hi. I want to move a container with some new files from one docker host to another docker host. Should I use save or export? Please clear this confusion for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment