拷贝docker镜像,转移到其他宿主机

avatar

拷贝docker镜像,转移到其他宿主机

实际工作中有拷贝docker images到其他主机的情况,通常是通过pull的方式,但那需要仓库。

能不能直接打包文件,转移镜像到其他宿主机?

用 docker images 来列出本地主机上的镜像。
$ docker images

1 sudo docker save -o steem-22.2 ./steem-22.2.tar
把本机的steem-22.2 镜像保存为当前目录下的归档文件steem-22.2.tar ,然后把此文件拷贝到其他主机

2 在需要还原docker image的主机执行(宿主机必须装有docker)
sudo docker load < steem-22.2.tar

提示steem-22.2 表示加载成功,就可继续使用这个docker 镜像。

save docker镜像的时候,可将多个images保存为一个文件,导出时候也就一并导出多个镜像。



0
0
0.000
1 comments
avatar

He said, 'Stop doing wrong things and turn back to God! The kingdom of heaven is almost here.'(Matthew 3:2)

Question from the Bible, What is the best religion in the world?

Watch the Video below to know the Answer...
(Sorry for sending this comment. We are not looking for our self profit, our intentions is to preach the words of God in any means possible.)


Comment what you understand of our Youtube Video to receive our full votes. We have 30,000 #SteemPower. It's our little way to Thank you, our beloved friend.
Check our Discord Chat
Join our Official Community: https://steemit.com/created/hive-182074

0
0
0.000