docker安装tomcat9
时间: 2023-09-18 08:09:37 浏览: 99
要在Docker中安装Tomcat 9,可以按照以下步骤进行操作。首先,下载Tomcat 9.0镜像,可以使用命令docker pull tomcat:9.0来下载。然后,使用命令docker images来查看镜像是否已成功下载。接下来,可以编译DockerFile文件,使用命令docker build -f /usr/local/temp/DockerFile -t chendd-tomcat:tomcat9.0.16来生成chendd-tomcat:9.0.16的镜像。停止容器可以使用命令docker stop tomcat9,删除容器可以使用命令docker rm tomcat9。再次创建并启动容器时,可以使用以下命令来挂载目录并设置端口:docker run -p 8081:8080 --name tomcat9 -v /home/docker-work/tomcat/conf/:/usr/local/tomcat/conf -v /home/docker-work/tomcat/logs/:/usr/local/tomcat/logs -v /home/docker-work/tomcat/webapps/:/usr/local/tomcat/webapps -v /home/docker-work/tomcat/work/:/usr/local/tomcat/work -v /home/docker-work/tomcat/temp/:/usr/local/tomcat/temp -d tomcat:9.0。这样就完成了Docker安装Tomcat 9的过程。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Docker安装Tomcat并设置挂载卷(超详细)](https://blog.csdn.net/y393016244/article/details/129806762)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [Docker学习(四)使用DockerFile的方式安装Tomcat9](https://blog.csdn.net/haiyangyiba/article/details/88805614)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文