Detailed steps for deploying Tomcat in Docker and deploying Java applications

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.