tomcat8-jdk8-centos-docker/tomcat-jdk-opencv/DockerFIle

30 lines
999 B
Plaintext
Raw Normal View History

2024-02-03 22:48:48 +08:00
# vim Dockerfile
FROM centos
2024-03-03 15:39:01 +08:00
COPY ../README.md /usr/local/README.md
2024-02-03 22:48:48 +08:00
# 会自动解压到指定目录,不需要人为去解压
2024-02-19 16:39:06 +08:00
ADD ../lib/jdk-8u401-linux-x64.tar.gz /usr/local
ADD ../lib/apache-tomcat-9.0.85.tar.gz /usr/local
ADD ../lib/opencv-4.9.0.sh /usr/local/opencv-4.9.0.sh
2024-02-03 22:48:48 +08:00
2024-02-04 00:23:49 +08:00
ENV MYPATH /usr/local
2024-02-03 22:48:48 +08:00
WORKDIR $MYPATH
2024-02-04 00:23:49 +08:00
RUN mv jdk1.8.0_401/ java/
RUN mv apache-tomcat-9.0.85/ tomcat/
ENV JAVA_HOME $MYPATH/java
ENV JAVA_VERSION jdk-8u401-linux-x64
2024-02-03 22:48:48 +08:00
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
2024-02-19 16:39:06 +08:00
ENV OPENCV_VERSION: 4.9.0
# 执行opencv 代码
RUN /usr/local/opencv-4.9.0.sh
2024-02-03 22:48:48 +08:00
EXPOSE 8080
2024-02-04 00:23:49 +08:00
VOLUME ["$TOMCAT_HOME/logs/","$TOMCAT_HOME/webapps"]
2024-02-03 22:48:48 +08:00
# 注意tail -F ,这里如果用小写的f启动容器的时候打印完日志后会退出用大写-F容器才会停留
2024-02-04 00:23:49 +08:00
CMD $TOMCAT_HOME/bin/startup.sh && tail -F $TOMCAT_HOME/logs/catalina.out
2024-02-03 22:48:48 +08:00