tomcat8-jdk8-centos-docker/tomcat-openjdk/DockerFile

25 lines
921 B
Plaintext
Raw Normal View History

2024-03-03 15:39:01 +08:00
FROM debian
COPY ../README.md /usr/local/README.md
# 会自动解压到指定目录,不需要人为去解压
ADD ../lib/apache-tomcat-9.0.85.tar.gz /usr/local
ADD ../lib/openlogic-openjdk-11.0.22+7-linux-x64.tar.gz /usr/local
ENV MYPATH /usr/local
WORKDIR $MYPATH
RUN mv apache-tomcat-9.0.85/ tomcat/
RUN mv openlogic-openjdk-11.0.22+7-linux-x64/ java/
ENV JAVA_HOME $MYPATH/java
ENV JAVA_VERSION openlogic-openjdk-11.0.22+7-linux-x64
ENV TOMCAT_HOME $MYPATH/tomcat
ENV TOMCAT_VERSION apache-tomcat-9.0.85
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin
EXPOSE 8080
EXPOSE 8080
VOLUME ["$TOMCAT_HOME/logs/","$TOMCAT_HOME/webapps"]
# 注意tail -F ,这里如果用小写的f启动容器的时候打印完日志后会退出用大写-F容器才会停留
CMD $TOMCAT_HOME/bin/startup.sh && tail -F $TOMCAT_HOME/logs/catalina.out