1.在hub.docker.com中获取tomcat拉取地址
docker pull tomcat:9.0.41-jdk8-corretto
2.查看Dockerfile
中WORKDIR 为/user/local/tomcat,CATALINA_HOME为/user/local/tomcat
注:查看CATALINA_HOME主要是为了做宿主机与容器的持久化
3.拉取tomcat镜像
docker pull tomcat:9.0.41-jdk8-corretto
4.运行tomcat
docker run -d -p 8080:8080 --name mytomcat9 -v /usr/local/tomcat9/webapps/demo1:/usr/local/tomcat/webapps/demo1 -v /usr/local/tomcat9/logs/:/usr/local/tomcat/logs b25d83ca5c62