目录
(2)将helloword镜像导出到宿主机,并且将该镜像命名为helloworld.tgz
(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