7.commit镜像
2023-11-19 本文已影响0人
_FireFly_
commit镜像


1.查看docker镜像列表
docker images

2.启动tomcat
docker run -d tomcat

3.进入tomcat容器
docker exec -it d52b87346059 /bin/bash

4.此时查看webapps里面是空的

5.拷贝webapps.dist目录下的所有东西到webapps下
cp -r webapps.dist/* webapps #-r:以递归的方式进行拷贝 /*:所有文件

6.查看webapps中文件内容 拷贝成功

7.exit 退出tomcat容器
eixt #退出容器

8.查看容器 docker ps
docker ps


9.提交修改了webapps的tomcat
docker commit -a="guobaofeng" -m:"add webapps app" d52b87346059 tomcat02:1.0
#-a:作者 -m:备注本次提交的内容

10.再次查看docker images 确定刚刚自定义提交的tomcat镜像是否成功

