Docker 复制镜像到其他主机

在存在镜像的主机上将所需的docker 镜像打包

docker save 镜像名:版本号 -o /路径/保存的包名.tar

 将打包好的镜像拷贝到所需的主机上

 将镜像解压,应用到所需的主机上

docker load < 保存的包名.tar

实例:

[root@test1 ~]# docker save calico/cni:v3.13.3 -o ./calico-cni-v3.13.3.tar
[root@test1 ~]# scp calico-cni-v3.13.3.tar 192.168.137.133:/root/

[root@test2 ~]# docker load < calico-cni-v3.13.3.tar
[root@test2 ~]# docker images
REPOSITORY                          TAG                 IMAGE ID            CREATED             SIZE
busybox                             latest              78096d0a5478        12 days ago         1.22MB
calico/node                         v3.13.3             3efc460414d9        4 weeks ago         261MB
calico/pod2daemon-flexvol           v3.13.3             d8e1bc26a77b        4 weeks ago         112MB
calico/cni                          v3.13.3             8229c7314d00        4 weeks ago         224MB
weaveworks/weaveexec                2.6.2               4f1fc48398d9        2 months ago        149MB
weaveworks/weave                    2.6.2               a37f4211904c        2 months ago        98.7MB
weaveworks/weavedb                  latest              6898eac75586        6 months ago        698B
index.alauda.cn/sequenceiq/consul   v0.5.0-v6           0af2589a3601        4 years ago         67.9MB

 

posted @ 2020-05-26 16:30  彦祚  阅读(3700)  评论(1编辑  收藏  举报