Can't run webapplication on tomcat using Docker
This is your whole Dockerfile?
Because You just remove all ROOT content (step #3)
then copy war file with your application (step #4) - probably wrong folder in the question only (should be /usr/local/tomcat/webapps/)
But I don't see any endpoint or start foreground application.
I suppose you need to add:
CMD ["/usr/local/tomcat/bin/catalina.sh", "run"]
and with that just run tomcat. And It is routines to EXPOSE
port, but when you are using -p
docker does an implicit exposing.
So your Dockerfile should looks like:
# Pull base imageFrom tomcat:7-jre7# MaintainerMAINTAINER "xyz <xyz@email.com"># Copy to images tomcatRUN rm -rf /usr/local/tomcat/webapps/ROOT# fixed path for copyingCOPY file.war /usr/local/tomcat/webapps/# Routine for me - optional for your caseEXPOSE 8080# And run tomcatCMD ["/usr/local/tomcat/bin/catalina.sh", "run"]