10

I would like to use ssh as a transport mechanism for transferring docker images hosted in corporate network to private cloud. Setting up VPN connections would not be my first choice (as it just adds to the complexity). Any ideas where to look/start for this

Edit: I and potentially many of my team members would be doing this many times a day (both pulling and pushing)

geoaxis
  • 1,480
  • 6
  • 25
  • 46
  • the private registry runs on a port. Just tunnel the port. – user2105103 Oct 13 '14 at 18:59
  • 2
    possible duplicate of [How to copy docker images from one host to another without via repository?](http://stackoverflow.com/questions/23935141/how-to-copy-docker-images-from-one-host-to-another-without-via-repository) – leo May 07 '15 at 15:17

1 Answers1

43

Here's one way to do it 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 image (including its layers)
  • -C is for ssh to compress the data stream
  • docker load creates a docker image from a tar archive
Thomasleveil
  • 95,867
  • 15
  • 119
  • 113
  • 3
    Wouldn't it be a overkill for images where I just want to send the diff. – geoaxis Oct 13 '14 at 19:00
  • 1
    it would but AFAIK only the [docker pull](https://docs.docker.com/reference/commandline/cli/#pull) command does download only the missing layers but this command pulls from docker registries, not docker hosts so you would have to setup a private registry and tunnel to the registry port. I guess it all depend on if you want to do this once in a while or regularly. – Thomasleveil Oct 13 '14 at 19:03