tomcat镜像制作
- 可通过官网下载对应的tomcat镜像版本tomcat镜像链接
- 相关配置解释
关键在于WORKDIR /usr/local/tomcat 指定tomcat的工作目录
以及指定jdk的版本一般使用jdk8即可
润乾配置问题梳理
1.将webapps下的tomcat项目全部copy下来
2.修改添加润乾报表的licence
- 默认的licence文件在 webapps/cpdc-cdb-leasing-report/WEB-INF/classes/defaultlicensetrial_zh.xml文件
- 配置licence
raqsoftConfig.xml 修改 <license></license> 路径即可
dockerfile文件参考
1.制作docker镜像
···
FROM harbor.assistfc.com/base/tomcat:8.5.82-jre8 //基于官方tomcat tomcat:8.5.82-jre8 制作
MAINTAINER wade.qu wade.qu@fosun.com
RUN apt-get update
RUN apt-get install -y tzdata //解决时区问题不同步
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime //上海时区配置
ADD apache-tomcat-8.5.82/webapps/cpdc-cdb-leasing-report /usr/local/tomcat/webapps/cpdc-cdb-leasing-report/ //将润乾项目copy到tomcat下
执行命令:
root@wadequ-ThinkPad-L13:/opt/office# docker build . -t tomcat:1.9.0
Sending build context to Docker daemon 424.3MB
Step 1/6 : FROM harbor.assistfc.com/base/tomcat:8.5.82-jre8
---> 0065fb7141cd
Step 2/6 : MAINTAINER wade.qu wade.qu@fosun.com
---> Using cache
---> 9d5744528db9
Step 3/6 : RUN apt-get update
---> Using cache
---> 508e106095a8
Step 4/6 : RUN apt-get install -y tzdata
---> Using cache
---> 231d914e8b1f
Step 5/6 : RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
---> Using cache
---> 9bd6a7560eeb
Step 6/6 : ADD apache-tomcat-8.5.82/webapps/cpdc-cdb-leasing-report /usr/local/tomcat/webapps/cpdc-cdb-leasing-report/
---> 515c567729f7
Successfully built 515c567729f7
Successfully tagged tomcat:1.9.0
···
启动命令
docker run -d -p 8081:8080 -name my-tomcat tomcat:1.9.0
访问验证
curl -v localhost:8080/cpdc-cdb-leasing-report/monitor.jsp