FROM centos MAINTAINER taohaijun "[email protected]" WORKDIR /home #上传安装包 COPY jdk-8u131-linux-x64.rpm /home/ #安装JDK RUN rpm -ivh /home/jdk-8u131-linux-x64.rpm && rm -rf /home/jdk-8u131-linux-x64.rpm #设置环境变量 ENV JAVA_HOME /usr/java/jdk1.8.0_131 ENV PATH $PATH:$JAVA_HOME/bin #安装tomcat RUN mkdir Tomcat COPY apache-tomcat-7.0.82.tar.gz /home/ RUN tar zxf /home/apache-tomcat-7.0.82.tar.gz -C /home/Tomcat && rm -rf /home/apache-tomcat-7.0.82.tar.gz #部署项目 COPY fhm.war /home/Tomcat/apache-tomcat-7.0.82/webapps EXPOSE 8080 #启动容器 ENTRYPOINT /home/Tomcat/apache-tomcat-7.0.82/bin/startup.sh && tail -f /home/Tomcat/apache-tomcat-7.0.82/logs/catalina.out
docker build -t tomcat-fhm:1.0 /home/