将容器变为镜像

docker commit -a "作者名称" -m "提交时的说明文字" 容器ID 新创建的镜像名称

可用参数
-a :提交的镜像作者;
-c :使用Dockerfile指令来创建镜像;
-m :提交时的说明文字;
-p :在commit时,将容器暂停。
imagexxx 是新创建的镜像的名字

docker commit -a "bitto" cefd9c16f80f tomcat:4

将镜像打包成tar包
docker save -o 名称.tar 新创建的镜像名称:版本号
docker  save  -o xxx.tar  imagexxx # 当前路径下会生成一个xxx.tar