In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how Docker automatically deploys Apache Tomcat. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Use docker search to find the most popular (and official) Docker Tomcat containers:
# docker search tomcatINDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATEDdocker.io docker.io/tomcat Apache Tomcat is an open source implementa... 178 [OK] docker.io docker.io/consol/tomcat-7.0 Tomcat 7.0.57, 8080, "admin/admin" 12 [OK] docker.io docker.io/consol/tomcat-8.0 Tomcat 8.0.15, 8080 "admin/admin" 10 [OK] docker.io docker.io/consol/tomcat-6.0 Tomcat 6.0.43, 8080, "admin/admin" 6 [OK] docker.io docker.io/dordoka/tomcat Ubuntu 14.04, Oracle JDK 8 and Tomcat 8 ba... 4 [OK] docker.io docker.io/malderhout/tomcat Tomcat7 with OpenJDK7 on CentOS7 3 [OK] docker.io docker.io/cloudesire/tomcat Tomcat server 6-7-8 with oracle java 7/8 o... 2 [OK] docker.io docker.io/ericogr/tomcat Tomcat 8.0.23, 8080, "docker/docker" 1 [OK] docker.io docker.io/liferay/tomcat Tomcat version used by Portal bundles (onl... 1 [OK] docker.io docker.io/learninglayers/tomcat 0 [OK]
Use docker pull to download the official image. Here I choose the official tomcat,latest version.
# docker pull tomcat
After the download is complete, use the docker images command to view the image
# docker imagesREPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZEdocker.io/tomcat latest cb8603fe47ec 3 weeks ago 347.8 MB
Extending Dockerfile I need to extend Dockerfile to automate the deployment of Maven. You need to add settings.xml and update the tomcat-users.xml file. As follows:
Tomcat-users.xml:
Settings.xml:
TomcatServerchag111111
These files are placed in the same directory as Dockerfile.
The Dockerfile is updated to:
FROM tomcatMAINTAINER "CHAG" ADD settings.xml / usr/local/tomcat/conf/ADD tomcat-users.xml / usr/local/tomcat/conf/
When the image is built, the configuration file is placed in the correct directory. Any container launched from this image will contain these files.
Refactoring image: in the current file directory
# docker build-t chag/tomcat.
Start the container:
# docker run-d-name tomcat-p 8080 chag/tomcat
You can access the tomcat service using the IP:8080 of the host
Thank you for reading! This is the end of the article on "how Docker automatically deploys Apache Tomcat". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.