commit提交镜像
docker commit 提交容器成为一个新的副本
#命令
docker commit -m=“提交的描述信息” -a=“作者” 容器ID 目标镜像名:[tag]
[root@liuyang local]# docker commit -a='liuyang' -m="centos_ly" 35cfd4624056 centos:1.2
sha256:c7755e562e146c1382e55b53887aa47bfd52314a05ee2c4a947340e0aec67266
[root@liuyang local]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
35cfd4624056 centos "/bin/bash" About a minute ago Up About a minute lucid_elgamal
c67b2a575a6e tomcat "catalina.sh run" 9 minutes ago Up 9 minutes 8080/tcp cranky_sanderson
[root@liuyang local]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 1.2 c7755e562e14 7 seconds ago 209MB
tomcat latest 040bdb29ab37 8 weeks ago 649MB
centos latest 300e315adb2f 3 months ago 209MB
这样我们就获得了自己的镜像