Deploying Spring WAR to Tomcat-based docker

Viewed 8895

I have followed through Spring's Building a RESTful Web Service tutorial and created a dummy webapp (with "Build with Maven" instructions). I build and package the WAR. Then I run it with this command:

java -jar ./target/Dummy-1.0-SNAPSHOT.war

I can see the dummy JSON endpoint at http://localhost:8080/greeting/.

Now I want to containerize the app with Docker so I can further test it without the needs to install Tomcat to system space. This is the Dockerfile I created:

FROM tomcat:7-jre8-alpine

# copy the WAR bundle to tomcat
COPY /target/Dummy-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/app.war

# command to run
CMD ["catalina.sh", "run"]

I build and run the docker binding to http://localhost:8080. I can see the Tomcat welcome page on "http://localhost:8080". But I couldn't see my app on neither:

How should I track down the issue? What could be the problem?

Update 1: The Tomcat admin interface screenshot

Tomcat Admin

1 Answers
Related