Export :
Export is used to persist a container (not an image). So we need the container id which we can see like this
sudo docker ps -a
To export a container we simply do:
sudo docker export <CONTAINER ID> > /home/export.tar
SAVE :
The result is a TAR-file which should be around 2.7 MB big (slightly smaller than the one from save).
Save is used to persist an image (not a container). So we need the image name which we can see like this:
sudo docker images
To save an image we simply do:
sudo docker save (image name)> /home/save.tar
The result is a TAR-file which should be around 2.8 MB big (slightly bigger than the one from export).
Save and Export are both used for sharing tar files. But, Save is used for images and can save multiple images into a tar file with all the layers and history. Export is used for containers without any history or layers.