构建tomcat镜像的dockerfile
来源:原创
时间:2019-10-21
作者:脚本小站
分类:云原生
构建tomcat镜像:
FROM centos:centos7 ADD jdk-8u231-linux-x64.tar.gz /usr/local/ RUN ln -s /usr/local/jdk1.8.0_231 /usr/local/java ENV JAVA_HOME=/usr/local/java RE_HOME=$JAVA_HOME/jre CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin ADD apache-tomcat-8.5.37.tar.gz /usr/local/ RUN ln -s /usr/local/apache-tomcat-8.5.37 /usr/local/tomcat ENV CATALINA_HOME=/usr/local/tomcat CATALINA_BASE=/usr/local/tomcat PATH=$PATH:${CATALINA_HOME}/bin RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone EXPOSE 8080 ENTRYPOINT ["/usr/local/tomcat/bin/catalina.sh","run"]
需要jdk安装包和tomcat安装包:
apache-tomcat-8.5.37.tar.gz jdk-8u231-linux-x64.tar.gz