title: Deploying Spring WAR to Tomcat-based docker
body: <p>I have followed through Spring's <a href="https://spring.io/guides/gs/rest-service/" rel="noreferrer">Building a RESTful Web Service</a> tutorial and created a dummy webapp (with "Build with Maven" instructions). I build and package the WAR. Then I run it with this command:</p>
  
  <pre><code>java -jar ./target/Dummy-1.0-SNAPSHOT.war
  </code></pre>
  
  <p>I can see the dummy JSON endpoint at <a href="http://localhost:8080/greeting/" rel="noreferrer">http://localhost:8080/greeting/</a>.</p>
  
  <p>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 <code>Dockerfile</code> I created:</p>
  
  <pre><code>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"]
  </code></pre>
  
  <p>I build and run the docker binding to <a href="http://localhost:8080" rel="noreferrer">http://localhost:8080</a>. I can see the Tomcat welcome page on "<a href="http://localhost:8080" rel="noreferrer">http://localhost:8080</a>". But I couldn't see my app on neither:</p>
  
  <ul>
  <li><a href="http://localhost:8080/app/" rel="noreferrer">http://localhost:8080/app/</a></li>
  <li><a href="http://localhost:8080/app/greeting/" rel="noreferrer">http://localhost:8080/app/greeting/</a></li>
  <li><a href="http://localhost:8080/greeting/" rel="noreferrer">http://localhost:8080/greeting/</a></li>
  </ul>
  
  <p>How should I track down the issue? What could be the problem?</p>
  
  <h2>Update 1: The Tomcat admin interface screenshot</h2>
  
  <p><a href="https://i.stack.imgur.com/Rn35u.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Rn35u.png" alt="Tomcat Admin"></a></p>