Docker image push over SSH (distributed)

If you want to push docker images to a given host, there is already everything in Docker to allow this. The following example shows how to push a docker image through ssh:

docker save <my_image> | ssh -C user@my.remote.host.com docker load
  • docker save will produce a tar archive of one of your docker images (including its layers)
  • -C is for ssh to compress the data stream
  • docker load creates a docker image from a tar archive

Note that the combination of a docker registry + docker pull command has the advantage of only downloading missing layers. So if you frequently update a docker image (adding new layers, or modifying a few last layers) then the docker pull command would generate less network traffic than pushing complete docker images through ssh.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)