Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker+SSH, how to transfer docker images from one host to another securely on a regular basis?

Tags:

docker

ssh

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)

like image 646
geoaxis Avatar asked Oct 13 '14 18:10

geoaxis


People also ask

Can you copy docker image locally?

To export your image to a tar file, run the docker save command, specifying a name for the . tar file, and the docker image name. This will save the docker image locally.


1 Answers

Here's one way to do it through ssh:

docker save <my_image> | ssh -C [email protected] 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
like image 149
Thomasleveil Avatar answered Nov 15 '22 18:11

Thomasleveil