The previous article has installed the docker service. Now let’s continue to introduce how to deploy a web project. 1: Create a directory dock at random and prepare the following files: 2. Write Dockerfile, which can quickly build docker images vi Dockerfile Add the following configuration FROM centos MAINTAINER this is dock image <jsh> ADD jdk1.8.0_191 /usr/local/java ENV JAVA_HOME /usr/local/java ENV JAVA_BIN /usr/local/java/bin ENV JRE_HOME /usr/local/java/jre ENV PATH $PATH:/usr/local/java/bin:/usr/local/java/jre/bin ENV CLASSPATH /usr/local/java/jre/bin:/usr/local/java/lib:/usr/local/java/jre/lib/charsets.jar ADD apache-tomcat-8.5.40 /usr/local/tomcat8 ENTRYPOINT ["/usr/local/tomcat8/bin/catalina.sh","run"] ADD ./manager.war /usr/local/tomcat8/webapps EXPOSE 8080 explain: 3. Build an Image Command: docker build -t dock . (space after dock.) to complete the build automatically. dock identifies the image name 4. Run the container Command: View all running container commands: 5. Test deployment results ip:8060 If the tomcat page appears, it means that the container has been started successfully. This is the end of this article about the implementation of Docker deployment of web projects. For more relevant content about Docker deployment of web projects, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of axios encapsulation and API interface management in React project
>>: What is the relationship between Mapper sql statement fields and entity class attribute names
Author | Editor Awen | Produced by Tu Min | CSDN ...
Table of contents Implementation ideas There are ...
A design soldier asked: "Can I just do pure ...
Ubuntu 20.04 has been officially released in Apri...
Preface Samba is a free software that implements ...
Preface The best method may not be the one you ca...
1. The value used in the button refers to the text...
After IntelliJ IDEA deploys a Javaweb project usi...
1. Download the download link Click download. You...
#mysql -uroot -p Enter password mysql> show fu...
Preface: I have always wanted to know how a SQL s...
In addition to B-Tree indexes, MySQL also provide...
As components become more detailed, you will enco...
Description of port availability detection when p...
Table of contents 1. Problem Description 2. Cause...