Author: Sit forget peak font: [Increase decrease] Type: Reprint time: 2016-10-08 I would like to comment on how to deploy Tomcat in Docker and how to deploy our application to Tomcat in the Docker container, which is described in detail and has reference value. , let's have a look.
let's start with a simple Docker concept.
Docker is an open source application container engine that allows developers to package their apps and dependencies into a portable container, and then publish it to any popular Linux machine or virtualization. Containers are completely using the sandbox mechanism, and there will be no interface between each other.
1, first say how to deploy Tomcat in Docker
The first step: root user Login in the system root directory to create a folder TOMCAT7, commands such as: mkdir TOMCAT7, and switch to the directory: CD TOMCAT7;
Step Two: Create Dockerfile, commands such as: Touch Dockerfile;
Step three: Write Dockerfile, commands such as: Vim Dockerfile, complete the following command to write:?
| 1 2 3 4 5 6 7 8 9 of |
from ubuntu:14.04 maintainer Zhaichong & lt;344616313@qq.com> ENV refreshed_at 2015-7-28 RUN apt-get-yqq update RUN apt-get-yqq install TOMCAT7 EN V CATALINA_HOME/USR/SHARE/TOMCAT7 env CATALINA_BASE/VAR/LIB/TOMCAT7 env catalina_pid/var/run/tomcat7.pid env CATALINA _sh/usr/share/tomcat7/bin/catalina.sh ENV catalina_tmpdir/tmp/tomcat7-tomcat7-tmp RUN mkdir-p $CATALINA _tmpdir VOLUME ["/var/lib/tomcat7/webapps/"] expose 8080 9000 |