I am using Jenkins to deploy a maven hello-world file to a docker tomcat image. 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. The tomcat is working though
The Repo which contains the Jenkinsfile and Dockerfile is https://github.com/Kush-2806/Maven-Docker-CI
You have an error in your 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/
Update the Dockerfile
to this:
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.