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
Preface As we all know, HTML5 belongs to the Worl...
Table of contents 1. Example 2. Create 100 soldie...
Preface You should often see this kind of special...
Table of contents 1. Two-way binding 2. Will the ...
ssh-secure shell, provides secure remote login. W...
routing vue-router4 keeps most of the API unchang...
The CSS3 category menu effects are as follows: HT...
The Riddle vulnerability targeting MySQL versions...
When using XAML layout, sometimes in order to make...
Copy code The code is as follows: <select> ...
01. Command Overview The paste command will merge...
The first method: dynamically add a class to show...
1. Background Generally, for Docker containers th...
Related reading: Solve the problem that the servi...
After the form is submitted, the returned HTML pag...