Docker Deployment Project - Demo tomcat
0. Relevant File
1. Write Dockerfile
We will place the apache-tomcat-9.0.73.tar.gz
and jdk-8u361-linux-x64.tar.gz
files in the same folder.
And in this folder, write the Dockerfile
file, with the specific configuration as follows:
1 |
|
You can view additional help information in the Dockerfile Help.
Tip: To specify a configuration file other than Dockerfile
, you must use the -f
option to provide the file name.
2. Build and Run
2.1 Build Image:
1 |
|
The -t
represents a tag
.
You can view more help information on the build command document.
2.2 Run Container:
1 |
|
The -d
represents running the container in the background
and printing its container ID.
The -v
represents binding a mount to volume
.
You can view additional help information in the run command document.
2.3 Enter Container
1 |
|
Docker Deployment Project - Demo tomcat
https://www.hardyhu.cn/2023/04/17/Docker-Deployment-Project-Demo-tomcat/