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
Table of contents Demand background Thought Analy...
Table of contents 1. Function Binding 2. With par...
How to change the MySQL database directory locati...
If I want to make the form non-input-capable, I se...
Table of contents 1. The default focus is on the ...
I have a server with multiple docker containers d...
MySQL 8.0 for Windows v8.0.11 official free versi...
1. Write a split script (splitNginxLog.sh) * Beca...
Assume that a node in the three-node MGR is abnor...
I am a beginner in SQL and thought that the insta...
Preface Nodejs is a server-side language. During ...
Table of contents 1. Four concepts 1. JavaScript ...
Vmware Installation Installing Packages Download ...
1. Check the character set of the database The ch...
Simply pull the image, create a container and run...