Docker Image Save/Load

Docker Image Save

This command is used to save the image to a tar archive. It saves the image as a tar archive to the standard output stream and can be used to save one or more images at a time. 

Save command maintains all the information about the parent layers, tags, versions, and specified repository tags.


$ docker save [OPTIONS] IMAGE [IMAGE...]


 --output , -o   Used to write to a file instead of STDOUT


$ docker save myimage > myimage.tar


$ docker save --output myimage.tar myimage 

Save command will save all the images available to a single tar file if the tag is not specified.

For e.g.

$ docker save image ubuntu

The above command will save all the available images of Ubuntu in a single tar file.

To save a specific ubuntu image use the below command -

$ docker image save ubuntu:10.04 > ubuntu.tar

Docker Image Load

The load command is used to restore an image from a tar archive. It can read an image from the Standard Input Stream(STDIN) or a file. This command will restore the image along with all its layers and tags.


$ docker image load [OPTIONS]


--input , -i   To read from a file instead of input stream

--quiet , -q   To Suppress the load output


$ docker image load < myimage.tar


$ docker image load --input myimage.tar