In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. create a directory
[root@ticent docker]#mkdir /home/docker
2. Download tomcat
[root@ticent docker]#wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.0.45/bin/apache-tomcat-8.0.44.tar.gz
3. Download jdk
[root@ticent docker]# wget http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
4. Extract to current directory
5. Edit Dockerfile
[root@ticent docker]#vi Dockerfile
Click here to fold or open
FROM centos:latest
#install jdk
ADD jdk1.8.0_131 /opt/jdk8
ENV JAVA_HOME /opt/jdk8
ENV PATH $PATH:$JAVA_HOME/bin
RUN mkdir -p "$JAVA_HOME"
#install tomcat
ADD tomcat8 /opt/tomcat8
ENV CATALINA_HOME /opt/tomcat8
ENV PATH $CATALINA_HOME/bin:$PATH
RUN mkdir -p "$CATALINA_HOME"
WORKDIR $CATALINA_HOME
EXPOSE 8080
CMD ["catalina.sh", "run"]
6. Local centos mirror, here centos:latest
7. build images
[root@ticent docker]# docker build -t tomcat8 .
8. Start, tomcat port mapped to 18080
[root@ticent docker]# docker run -d -p 18080:8080 tomcat8
9. View docker progress
[root@ticent docker]# docker ps
10. Visit tomcat
11. into the container
docker exec -it 65f238010b2c /bin/bash
12. In this article, we use centos mirror to manually build jdk and tomcat into the mirror, which makes it easier to customize the runtime environment.
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.