Go to content

geek_stuff/server & linux

How to transfer docker image through ssh

When running multiple dockers on your network, there are times you can push and pull docker images back and forth.

To local image to other external docker service:

docker save name:tag | bzip2 | ssh remote docker load

even for more visual way

docker save imgName:tag | bzip2 | pv | ssh 192.168.0.x docker load

You don't need to save to file and move the file and load the file.

This answer is available in https://stackoverflow.com/questions/23935141/how-to-copy-docker-images-from-one-host-to-another-without-using-a-repository

[How to copy Docker images from one host to another without using a repository

How do I transfer a Docker image from one machine to another one without using a repository, no matter private or public? I create my own image in VirtualBox, and when it is finished I try to depl...

stackoverflow.com](https://stackoverflow.com/questions/23935141/how-to-copy-docker-images-from-one-host-to-another-without-using-a-repository)

If you need to pull external docker image on the fly and save as file:

ssh 192.168.0.x docker save imgName:latest | pv | gzip > ./imgName_latest.tar.gz

This way, you can save some time to saving images to file, loading file to image.

'geek_stuff > server & linux' 카테고리의 다른 글

killport - in bash  (1) 2023.05.08
How to fuzzy cd (change directory) to specific directory  (508) 2021.09.30
Setup NTP synchronization in WSL2 Ubuntu 20.04  (0) 2021.08.26
우분투 preseed 예제  (0) 2013.10.22
apt 사용시 proxy 사용  (0) 2012.08.06