Centos 7 下 docker 导入导出镜像 实践笔记

1.首先查看下本地仓库镜像

docker  images
[root@localhost ~]# docker images
REPOSITORY                                                TAG                 IMAGE ID            CREATED             SIZE
rancher/rancher                                           stable              5ebba94410d8        7 weeks ago         654MB
k8s.gcr.io/pause                                          3.1                 da86e6ba6ca1        2 years ago         742kB
registry.cn-beijing.aliyuncs.com/ilemonrain/pause-amd64   3.1                 da86e6ba6ca1        2 years ago         742kB

2.保存镜像到本地文件

docker save -o rancher.tar rancher/rancher:stable
# -o:指定保存的镜像的名字;
# rancher.tar:保存到本地的镜像名称;
# rancher/rancher:stable:镜像名字,通过"docker images"查看

3.载入镜像到本地仓库

docker load --input rancher.tar 
# 或 
docker load < rancher.tar
# 导入过程中可以看到镜像已经导入 或者可以用docker images查看
docker images #查看镜像已导入
发布了24 篇原创文章 · 获赞 29 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/cookily_liangzai/article/details/104021261