Article source: http://www.cnblogs.com/hello-tl/p/8929879.html
0. Download the mirror
# docker pull tomcat:8.5
1. Copy the tomcat configuration
Start tomcat first # docker run -d –-name tomcat -p 8081:8080 tomcat:8.5 Copy the configuration of tomcat to /data/tomcat8.5 # docker cp tomcat:/usr/local/tomcat /data/tomcat8.5 delete tomcat container # dicker rm -f tomcat
2. Start tomcat
Specify configuration and static file locations # docker run -d –privileged=true –name tomcat \ -v /data/tomcat8.5/webapps:/usr/local/tomcat/webapps\ -v /data/tomcat8.5/conf:/usr/local/tomcat/conf \ -p 8081:8080 tomcat8.5
3. Basic operation
Now the value code is uploaded to /data/tomcat8.5/webapps After uploading, execute # docker restart tomcat -d: run the program in the background -name: container name -v: hang from the host directory to the container directory -p: map the host host port
Article source: http://www.cnblogs.com/hello-tl/p/8929879.html