commit 8fc95e458d6076d862875ac332301c2389867c29 Author: wanghongjian Date: Sat Feb 3 22:48:48 2024 +0800 首次提交 diff --git a/DockerFile b/DockerFile new file mode 100644 index 0000000..9536719 --- /dev/null +++ b/DockerFile @@ -0,0 +1,26 @@ +# vim Dockerfile + +FROM centos +COPY README.md /usr/local/README.md +# 会自动解压到指定目录,不需要人为去解压 +ADD jdk-8u401-linux-x64.tar.gz /usr/local/ +ADD apache-tomcat-9.0.85.tar.gz /usr/local/ + +ENV MYPATH /usr/local/ +WORKDIR $MYPATH +ENV JAVA_HOME $MYPATH/jdk-8u401 +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 CATALINA_HOME $TOMCAT_HOME +ENV CATALINA_BASH $TOMCAT_HOME +ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin + +EXPOSE 8080 + +VOLUME ["$CATALINA_HOME/logs/","$CATALINA_HOME/webapps"] +#VOLUME ["/usr/local/apache-tomcat-9.0.54/logs/","/usr/local/apache-tomcat-9.0.54/webapps"] + +# 注意:tail -F ,这里如果用小写的f,启动容器的时候打印完日志后会退出,用大写-F容器才会停留 +CMD $CATALINA_HOME/bin/startup.sh && tail -F $CATALINA_HOME/logs/catalina.out + diff --git a/README.md b/README.md new file mode 100644 index 0000000..8df6e22 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +``` shell +docker build -f .\DockerFile -t tomcat-9-j8-centos . +# 推送 +docker login macrocc.com:3000 +docker push gitea.example.com/marcrocc/tomcat-9-j8-centos:latest +``` + diff --git a/apache-tomcat-9.0.85.tar.gz b/apache-tomcat-9.0.85.tar.gz new file mode 100644 index 0000000..649a612 Binary files /dev/null and b/apache-tomcat-9.0.85.tar.gz differ diff --git a/jdk-8u401-linux-x64.tar.gz b/jdk-8u401-linux-x64.tar.gz new file mode 100644 index 0000000..5caa6bb Binary files /dev/null and b/jdk-8u401-linux-x64.tar.gz differ