简体   繁体   English

部署到tomcat服务器的dockerfile不显示webapp

[英]dockerfile to deploy to tomcat server does not display webapp

I am using Jenkins to deploy a maven hello-world file to a docker tomcat image. 我正在使用Jenkins将Maven hello-world文件部署到docker tomcat映像。 the mvn clean package command works well in the jenkins job, and the subsequent dockerfile spawns an image where the webapp.war file will be placed in tomcat home directory.(/usr/local/tomcat/webapp/webapp.war) This is supposed to display o/p on the tomcat page running over port 8181, but i cannot get it to work. mvn clean package命令在jenkins作业中效果很好,随后的dockerfile生成了一个图像,将webapp.war文件放置在tomcat主目录中。(/ usr / local / tomcat / webapp / webapp.war)在端口8181上运行的tomcat页面上显示o / p,但我无法使其正常工作。 The tomcat is working though 雄猫正在工作

The Repo which contains the Jenkinsfile and Dockerfile is https://github.com/Kush-2806/Maven-Docker-CI 包含Jenkinsfile和Dockerfile的Repo是https://github.com/Kush-2806/Maven-Docker-CI

This is the output instead of the hello world 这是输出而不是hello world

You have an error in your Dockerfile . 您的Dockerfile有一个错误。

The directory is called /usr/local/tomcat/webapps/ , so you are just one s short - in your Dockerfile you copy to this location /usr/local/tomcat/webapp/ 该目录被称为/usr/local/tomcat/webapps/ ,所以你只是一个s短-在你Dockerfile复制到这个位置/usr/local/tomcat/webapp/

Update the Dockerfile to this: Dockerfile更新为此:

FROM tomcat:8.0

ADD ./webapp/target/*.war /usr/local/tomcat/webapps/

EXPOSE 8080

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

Now visit the site http://localhost:8181/webapp 现在访问站点http:// localhost:8181 / webapp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM