打包docker镜像并使用文件导入

将在线下载或者自己编译的Docker镜像打成tar包,以备在没有网络的情况下,在其他服务器直接导入docker镜像。
1.查看当前镜像

[root@localhost docker-images]#  docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              c82521676580        3 weeks ago         109 MB

2.打包当前镜像

[root@localhost yum]# docker save -o images.tar postgres:9.6 mongo:3.4

3.将打包镜像导入目标服务器,并使用docker导入

[root@localhost yum]# docker load -i images.tar

你可能感兴趣的:(打包docker镜像并使用文件导入)