title: Deploying Java webapp to Tomcat 8 running in Docker container
body: <p>I am pretty new to Tomcat and Docker - so I am probably missing a Tomcat fundamental somewhere in this question.</p>
  
  <p>What I am trying to do is build a Docker container that runs a SpringBoot Restful web service that just returns some static data. This is all running on OSX so I am using Boot2Docker as well.</p>
  
  <p>I've written my own Dockerfile to build the container that my app runs in:</p>
  
  <pre><code>FROM tomcat:8.0.20-jre8
  
  RUN mkdir /usr/local/tomcat/webapps/myapp
  
  COPY /1.0-SNAPSHOT/my-app-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/myapp/
  </code></pre>
  
  <p>This Dockerfile works fine and I am able to start the container from the created image. </p>
  
  <pre><code>docker build -t myapp .
  
  docker run -it --rm -p 8888:8080 myapp
  </code></pre>
  
  <p>This container starts correctly and outputs no errors and displays the message saying my app was deployed.</p>
  
  <pre><code>22-Mar-2015 23:07:21.217 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory 
  Deploying web application directory /usr/local/tomcat/webapps/myapp
  </code></pre>
  
  <p>The container also correctly has the myapp.war copied to the path described in the Dockerfile. Moreover I am able to navigate to Tomcat default page to confirm that Tomcat is running, I can also hit all the examples, etc.</p>
  
  <p>To the problem, when I navigate to <a href="http://192.168.59.103:8888/myapp/getData">http://192.168.59.103:8888/myapp/getData</a> I get a 404. I can't quite figure out why. Am I missing something regarding a .war deploy to Tomcat?</p>