3-3.6 存出和载入docker镜像

使用 docker save 和 docker load 命令存出和载入镜像。

存出镜像

    将镜像存出到本地文件,使用docker save 。例如将busybox:latest镜像存出为文件bbox_latest.tar文件:

# docker images
REPOSITORY                                    TAG                 IMAGE ID            CREATED             SIZE
docker.io/busybox                             latest              22c2dd5ee85d        2 months ago        1.16 MB
# docker save -o bbox_latest.tar docker.io/busybox

载入镜像

    将本地的镜像文件导入到镜像仓库中,使用docker load。例如叫bbox_latest.tar文件导入到本地镜像库中,如下:

# docker load --input bbox_latest.tar

docker load < bbox_latest.tar

如此导入镜像及相关的元数据信息,使用 docker images查看。

猜你喜欢

转载自blog.csdn.net/ANXIN997483092/article/details/82831030