7 docker Centos the image import and export Practice notes

1. First check at the local repository mirror

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. Save the image to a local file

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

3. Load mirrored to a local warehouse

docker load --input rancher.tar 
# 或 
docker load < rancher.tar
# 导入过程中可以看到镜像已经导入 或者可以用docker images查看
docker images #查看镜像已导入
Published 24 original articles · won praise 29 · views 30000 +

Guess you like

Origin blog.csdn.net/cookily_liangzai/article/details/104021261