FROM ubuntu:14.10
MAINTAINER linx
#把java与tomcat添加到容器中,Add会解压
ADD jdk-8u151-linux-x64.tar.gz /usr/local/
ADD apache-tomcat-8.0.47.tar.gz /usr/local/
#将项目复制到webapps目录下,copy是不解压
copy exam.war /usr/local/apache-tomcat-8.0.47/webapps
#配置java与tomcat环境变量
ENV JAVA_HOME /usr/local/jdk1.8.0_151
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV CATALINA_HOME /usr/local/apache-tomcat-8.0.47
ENV CATALINA_BASE /usr/local/apache-tomcat-8.0.47
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin
#容器运行时监听的端口
EXPOSE 8080
#设置tomcat 自启动
CMD ["/usr/local/apache-tomcat-8.0.47/bin/catalina.sh", "run"]