容器生成镜像/导出/删除/导入

目录

(1)将容器生成新的镜像,镜像名字为helloworld;

(2)将helloword镜像导出到宿主机,并且将该镜像命名为helloworld.tgz

(3)将本地镜像仓库内的helloworld镜像删除

(4)将helloworld.tgz导入到本地镜像仓库中,并查看是否能正常运行。


(1)将容器生成新的镜像,镜像名字为helloworld;

1、查看容器进程

docker ps

2、生成镜像

docker commit 进程id 镜像名字:描述


(2)将helloword镜像导出到宿主机,并且将该镜像命名为helloworld.tgz

3、查看镜像id

docker images

4、导出镜像

docker save imageid |gzip > hello.tgz

(3)将本地镜像仓库内的helloworld镜像删除

docker rmi imageid

(4)将helloworld.tgz导入到本地镜像仓库中,并查看是否能正常运行。

docker import hello.tgz

docker images 名字为none

镜像命名:运行镜像,生成容器 → docker tag imageid helloworld:1.0

猜你喜欢

转载自blog.csdn.net/m0_65514616/article/details/129151516