Docker creates a mirror with JDK and Tomcat using Dockerfile

Source: Internet
Author: User
Tags tomcat docker run

Dockerfile content is as follows:

From ubuntu:14.04 

#刷新包缓存 and install wget tools
RUN apt-get update && apt-get install-y wget
#设置工作目录
Workdir/home
# Install JDK
RUN wget--no-cookies--no-check-certificate--header "cookie:gpw_e24=http%3a%2f% 2fwww.oracle.com%2ftechnetwork%2fjava%2fjavase%2fdownloads%2fjdk7-downloads-1880260.html;oraclelicense= Accept-securebackup-cookie "Http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz
RUN tar-zxf jdk-7u79-linux-x64.tar.gz

# Configure environment Variables
env java_home/home/jdk1.7.0_79
env jre_home $JAVA _home/ JRE
env CLASSPATH.: $JAVA _home/lib: $JRE _home/lib
ENV PATH $PATH: $JAVA _home/bin

#安装 tomcat7
#RUN Apt-get update
RUN wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.62/bin/ apache-tomcat-7.0.62.tar.gz
RUN tar xvf apache-tomcat-7.0.62.tar.gz

#配置tomcat的环境变量
ENV Catalina_ home/home/apache-tomcat-7.0.62

EXPOSE 8080

#设置tomcat self-starting
CMD ["/home/apache-tomcat-7.0.62/bin/ Catalina.sh "," Run "]

Can be used at startup:

Docker Run--name jy-moe-v/home/apache-tomcat-7.0.62/webapps/jy-moe:/home/apache-tomcat-7.0.62/webapps/jy-moe  -d-p 80:8080  ubuntu:tomcat7

-v Specifies the mounted volume, if not used

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.