tomcat8 docker容器上的默认webapp位置是什么?

时间:2016-07-31 23:13:40

标签: tomcat docker war

我试图将war文件部署到tomcat 8.5 docker容器:

https://hub.docker.com/_/tomcat/

我已经创建了一个Dockerfile,但我无法弄清楚我的war文件的复制位置

FROM tomcat:8.5
MAINTAINER nobody

RUN ["rm", "-rf", "/var/lib/tomcat8/webapps/ROOT"]  
RUN ["rm", "-rf", "/usr/share/tomcat8/webapps/ROOT"]

COPY companyNews.war /var/lib/tomcat8/webapps/companyNews.war
COPY companyNews.war /usr/share/tomcat8/webapps/companyNews.war
COPY companyNews.war /var/lib/tomcat/webapps/companyNews.war
COPY companyNews.war /usr/share/tomcat/webapps/companyNews.war

CMD ["catalina.sh", "run"]


EXPOSE 8080

有人可以告诉我在哪里复制我的战争档案吗?

2 个答案:

答案 0 :(得分:0)

tomcat:8.5

维护任何人

复制您的.war /usr/local/tomcat/webapps/your.war

CMD chmod + x /usr/local/tomcat/bin/catalina.sh

CMD [“ catalina.sh”,“运行”]

博览会8080

答案 1 :(得分:-1)

您需要将war文件复制到/usr/local/tomcat/webapps/

FROM tomcat:8.5

ADD your.war /usr/local/tomcat/webapps/

CMD ["catalina.sh", "run"]