1. Install tomcat8 with docker1. Find the tomcat image on Docker Hub docker search tomcat 2. Pull the tomcat image docker pull tomcat:8 3. Use the default configuration of Tomcat to start a Tomcat container docker run -d -p 8080:8080 --name tomcat tomcat:8 4. Copy the tomcat configuration files and logs in the container to the local machine for mapping docker cp tomcat:/usr/local/tomcat/conf /usr/app/tomcat/conf docker cp tomcat:/usr/local/tomcat/logs /usr/app/tomcat/logs 5. Stop tomcat and delete the container docker stop tomcat docker rm tomcat 6. Create and run the tomcat container docker run -d -p 8080:8080 --name tomcat -v /usr/app/tomcat/webapps:/usr/local/tomcat/webapps -v /usr/app/tomcat/conf:/usr/local/tomcat/conf -v /usr/app/tomcat/logs:/usr/local/tomcat/logs --restart=always tomcat:8 7. View the created container docker ps | grep tomcat NoticeWhen the Tomcat version is too high, the following problems may occur when accessing based on the IP address and port number: The 404 error occurs because the content in the webapps folder is empty. The content is in the webapps.dist directory. The solution is as follows: 1. Enter the tomcat container docker exec -it container id /bin/bash 2. Use ls to view the folder contents. You can find that there are webapps folder and webapps.dist folder. Move all the contents under webapps.dist to webapps. mv webapps.dist/* webapps 3. Revisit tomcat. Remember to allow security groups and firewalls. This is the end of this article about how to install tomcat8 with docker. For more information about installing tomcat8 with docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: HTML Tutorial: title attribute and alt attribute
>>: How to use cursor triggers in MySQL
Many websites have a navigation bar fixed at the ...
background Speaking of MySQL deadlock, I have wri...
vue scaffolding -> vue.cli Quickly create a la...
Static files Nginx is known for its high performa...
1 Problem Description This article sorts the esta...
Deleting a table is not very common, especially f...
This article example shares the specific code of ...
Table of contents introduce Example Summarize int...
Table of contents Styles in uni-app Summarize Sty...
.y { background: url(//img.jbzj.com/images/o_y.pn...
Table of contents The principle of Vue asynchrono...
Table of contents Preface && Operator || ...
During my internship in my senior year, I encount...
1.Mysql connection method To understand the MySQL...
Preface There are two types of nginx modules, off...