最近做项目,建好了不少不同规则的容器。需要以后重复利用,于是重新打包为镜像。 使用以下命令,查看容器名称:
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3e08cb5b24f8 gareenbeam/kyv10:v4 "/usr/sbin/init" 20 hours ago Up 7 seconds 0.0.0.0:3333->22/tcp gpmdw
运行以下命令,将容器导出为镜像
docker commit -a "Gavin Zhang" -m "Create a New Docker" 82a40abc415f gareenbeam/kyv10:v4
sha256:7a85ef121eb36c4fc0f840da2e8f0eb7cc5891ea41121a33c594f07a8827d5af
搞定!
标签:容器,0.0,gareenbeam,kyv10,镜像,Docker,打包 From: https://blog.51cto.com/u_1264026/7503953