1.
#Enter opt in the root directory 2.
#Create a Web folder 3.
#Enter the web folder 4.
#Create a Dockerfile folder. The name must be correct. Otherwise, it cannot be detected. 5. Use third-party tools to upload tomcat and jdk to the Web folder 6.
#Edit the file and write the following content FROM centos MAINTAINER ADD ./apache-tomcat-7.0.88.tar.gz /root ADD ./jdk-7u80-linux-x64.tar.gz /root ENV JAVA_HOME /root/jdk1.7.0_80 ENV PATH $JAVA_HOME/bin:$PATH ENTRYPOINT /root/apache-tomcat-7.0.88/bin/startup.sh && tail -F /root/apache-tomcat-7.0.88/logs/catalina.out Resource Downloads FROM command, usage, FROM <image>:<tag>, the FROM command tells Docker which (distribution) image we are building is based on ENV command, usage, ENV <key> <value>, the ENV command is mainly used to set the environment variables when the container is running ADD command, usage, ADD <src> <dest>, ADD is mainly used to add files in the host machine to the image 7.
#-t specifies the resource name to be customized # --rm=rtue Reduce the generation of non-specified files # After some files are automatically generated and downloaded, the request may time out. 8.
#Start tomcat and map port 8080 to port 9090 fe8d The first four digits of the resource ID 9.
# Start the second tomcat port without conflict!! 10. Open the browser server ip + port number and you can see the cat #docker will automatically add firewall rules. I use iptables firewall Simply build the dockerfile file and complete it! Additional knowledge: Building open source object storage (minio) in docker We did a project some time ago. The customer could not get the data to the external network, so we could only build OSS object storage on the internal network. We relied on Jidao's platform to do business. They adopted the S3 standard, so we used minio to build an open source OSS object storage space. It was actually very simple. docker pull minio/minio pulls the image from the repository docker run -p 9000:9000 --name minio1 -e “MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE” -e "MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" -v /mnt/data:/data -v /mnt/config:/root/.minio minio/minio server /data start up Let's talk about why to choose minio (1) C++ interface support is required. Since the S3 standard is adopted, Amazon AWS can use it. (2) This is a lightweight, highly concurrent solution (3) Compared with FastDFS or HDFS, the advantage is that it can reserve a certain feasibility for the front-end display. I will post the C++ and Java packages later. The above steps of deploying multiple tomcat services using DockerFile on Docker containers are all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. You may also be interested in:
|
<<: 8 powerful techniques for HTML web page creation
>>: Detailed explanation of the rounding accuracy problem of the toFixed() method in JS
For example: Copy code The code is as follows: <...
This article shares the specific code of Vue usin...
Common comments in HTML: <!--XXXXXXXX-->, wh...
Here I use samba (file sharing service) v4.9.1 + ...
You can add comments to MySQL SQL statements. Her...
This article shares the specific code of JavaScri...
Table of contents Select Structure Loop Structure...
This is my first blog. It’s about when I started ...
1. Embedded Software Level 1) Bootloader->Boot...
It’s great to use CSS to realize various graphics...
Summarize Global environment ➡️ window Normal fun...
Table of contents 1.setInterval() 2.setTimeout() ...
Table of contents Preliminary Notes Problem Repro...
Table of contents 1. Ant Design Vue 1. Official w...
1. Installation package preparation VMware-player...