docker set up tomcat environment

1. Assign Ali cloud docker source

STEP # . 1 : Some systems tools necessary to install 
the sudo yum the install -Y-yum-utils Device Mapper-persistent- Data LVM2 
# the Step 2 : Add the software source information 
the sudo yum -config-Manager---add the repo HTTP: // Mirrors .aliyun.com / Docker-CE / Linux / CentOS / Docker-ce.repo 
# the Step . 3 : update and install Docker- the CE 
the sudo yum makecache FAST 
the sudo yum -Y docker- the install CE 
# the Step . 4 : service open Docker 
sudo service docker start

2. Prepare the installation package

 

 

 3. In order to facilitate, to unzip tomcat

 

 

 4. Start writing dockerfile, we will tomcat placed under / usr / local directory mirroring, and the new image of / usr / local / tomcat / webapps as a mount point, as well as exposure to the default port: 8080 and 8443.

First, let's configure the required documents docker-compose and daemon.json

And give executable permissions

 

 

 

 

5. Exit Edit, New Mirror

 

6. Review the image is successfully created

7.访问测试,容器可访问。

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/xianglei_/p/12147991.html