Docker: Transferring Docker Images Without Registry

Sanket Meghani
2 min readNov 17, 2017

The ideal docker work flow for transferring docker images is through docker registry. We need to push the image to docker registry using docker push command and then others can pull the image using docker pull command.

However there might be a situation wherein we cannot use docker registry to transfer docker image to production. Say for example the production systems does not have access to non-production servers where registry is hosted, or during development we want to test the docker image quickly.

In such situations, we can transfer the docker image from one machine to another by exporting the image as a .tar file.

Saving docker image

Save the docker image using docker save command.

docker save --output saved-image.tar my-image:1.0.0

Alternatively, we can also use redirection to a file.

docker save my-image:1.0.0 > saved-image.tar

Both above command would create saved-image.tar with image data in current directory.

Transferring image

Once saved, transfer the .tar file to target server using any of the file transfer protocols like FTP or SCP.

Loading docker image

Once the .tar file is transferred to target machine, login to target machine and load the image into local registry using docker load command.

docker load --input saved-image.tar

Alternatively, we can also use redirection from a file.

docker load < saved-image.tar

Verify that the image is available on target machine by executing docker images command.

References

For more details about available options, please refer docker official documentation for docker save and docker load commands.

--

--

Sanket Meghani

Technical Advisor, Architect & Fullstack Developer — JavaScript, NodeJS, React, Redux, Java, Container Technologies