diff --git a/README.md b/README.md index 4e96e0b..28a65fb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ``` shell -docker build -f .\DockerFile -t tomcat-9-j8-centos . +docker build -f .\tomcat-openjdk\DockerFile -t tomcat9-jdk11-debian . # 推送 -docker tag tomcat-9-j8-centos:latest macrocc.com:3000/macrocc/tomcat-9-j8-centos:1.1.0 -docker push macrocc.com:3000/macrocc/tomcat-9-j8-centos:1.1.0 +docker tag tomcat9-jdk11-debian:latest macrocc.com:3000/macrocc/tomcat9-jdk11-debian:1.1.0 +docker push macrocc.com:3000/macrocc/tomcat9-jdk11-debian:1.1.0 ``` \ No newline at end of file diff --git a/lib/openlogic-openjdk-11.0.22+7-linux-x64.tar.gz b/lib/openlogic-openjdk-11.0.22+7-linux-x64.tar.gz new file mode 100644 index 0000000..0587aff Binary files /dev/null and b/lib/openlogic-openjdk-11.0.22+7-linux-x64.tar.gz differ diff --git a/tomcat-jdk-opencv/DockerFIle b/tomcat-jdk-opencv/DockerFIle index 81ce204..7f60831 100644 --- a/tomcat-jdk-opencv/DockerFIle +++ b/tomcat-jdk-opencv/DockerFIle @@ -1,7 +1,7 @@ # vim Dockerfile FROM centos -COPY README.md /usr/local/README.md +COPY ../README.md /usr/local/README.md # 会自动解压到指定目录,不需要人为去解压 ADD ../lib/jdk-8u401-linux-x64.tar.gz /usr/local ADD ../lib/apache-tomcat-9.0.85.tar.gz /usr/local diff --git a/tomcat-openjdk/DockerFile b/tomcat-openjdk/DockerFile new file mode 100644 index 0000000..ed4cf32 --- /dev/null +++ b/tomcat-openjdk/DockerFile @@ -0,0 +1,24 @@ +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 +