如下build之后,日志不出现catalina.out
FROM centos:latest MAINTAINER Reed "88fly@163.com" RUN mkdir -p /usr/local/jdk1.7.0_80 RUN mkdir -p /usr/local/apache-tomcat-8.5.73 ADD jdk1.7.0_80 /usr/local/jdk1.7.0_80 ADD apache-tomcat-8.5.73 /usr/local/apache-tomcat-8.5.73 ENV LC_ALL en_US.UTF-8 ENV JAVA_HOME /usr/local/jdk1.7.0_80 ENV CATALINA_HOME /usr/local/apache-tomcat-8.5.73 ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin EXPOSE 8080 CMD ["/usr/local/apache-tomcat-8.5.73/bin/catalina.sh","run"]
修改办法一:
直接修改打包前的tomcat启动文件apache-tomcat-8.5.73/bin/catalina.sh,去掉&符号
,然后把启动方式修改为
FROM centos:latest MAINTAINER Reed "88fly@163.com" RUN mkdir -p /usr/local/jdk1.7.0_80 RUN mkdir -p /usr/local/apache-tomcat-8.5.73 ADD jdk1.7.0_80 /usr/local/jdk1.7.0_80 ADD apache-tomcat-8.5.73 /usr/local/apache-tomcat-8.5.73 ENV LC_ALL en_US.UTF-8 ENV JAVA_HOME /usr/local/jdk1.7.0_80 ENV CATALINA_HOME /usr/local/apache-tomcat-8.5.73 ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin EXPOSE 8080 CMD ["/usr/local/apache-tomcat-8.5.73/bin/startup.sh"]
修改方法二
使用startup.sh启动,并查看tail -f 避免后台退出
FROM centos:latest MAINTAINER Reed "88fly@163.com" RUN mkdir -p /usr/local/jdk1.7.0_80 RUN mkdir -p /usr/local/apache-tomcat-8.5.73 ADD jdk1.7.0_80 /usr/local/jdk1.7.0_80 ADD apache-tomcat-8.5.73 /usr/local/apache-tomcat-8.5.73 ENV LC_ALL en_US.UTF-8 ENV JAVA_HOME /usr/local/jdk1.7.0_80 ENV CATALINA_HOME /usr/local/apache-tomcat-8.5.73 ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin EXPOSE 8080 CMD /usr/local/apache-tomcat-8.5.73/bin/startup.sh && tail -f /usr/local/apache-tomcat-8.5.73/logs/catalina.out
转载请注明:梦绘设计 » 虚拟化 » docker部署tomcat容器,无catalina.out日志问题解决
版权声明
本站《作品展示》类文章均为原创,转载必须注明出处,技术分享类文章部分来源于网络,版权归原作者所有,若侵权请留言。