假设你有一个image叫做ubuntu,那么你可以使用save和load命令来转移image:
在本机执行
sudo docker save -o ubuntu.tar ubuntu
由此得到了ubuntu.tar 文件,将其拷贝到远程机器,执行
sudo docker load < ubuntu.tar
eg:将10.239.52.120 的docker image:Ubuntu 拷贝到10.239.52.120上
首先登陆到10.239.52.120上将ubuntu打包
[root@localhost.localdomain ~]#ls
anaconda-ks.cfg ubuntu-rt-test.tar
[root@localhost.localdomain ~]#exit
logout
Connection to 10.239.52.120closed.
[root@localhost daisy_docker]# scproot@10.239.52.120:/root/ubuntu-rt-test.tar .
root@10.239.52.120's password:
ubuntu-rt-test.tar 100% 296MB 11.0MB/s 00:27
[root@localhostdaisy_docker]# ls
ubuntu-rt-test.tar
[root@localhost daisy_docker]#docker load < ubuntu-rt-test.tar
c8a75145fcc4: Loading layer 132.3MB/132.3 MB
c6f2b330b60c: Loading layer 15.87kB/15.87 kB
055757a19384: Loading layer 9.728kB/9.728 kB
48373480614b: Loading layer 4.608kB/4.608 kB
0cad5e07ba33: Loading layer 3.072kB/3.072 kB
22aa099196e4: Loading layer 177.7MB/177.7 MB
Loaded image:bamboojsr/ubuntu-rt-tests:latest
[root@localhost daisy_docker]#docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos latest 0584b3d2cf6d 2 weeks ago 196.5 MB
bamboojsr/ubuntu-rt-tests latest c75e67780a1f 10 weeks ago 299.8 MB