title: Spring boot app runs fine standalone, errs in docker
body: <p>I have a spring-boot based java application which runs fine from the command line (embedded tomcat standalone).</p>
  
  <p><strong>Problem</strong></p>
  
  <p>When I run the app in docker, it does not run correctly. The console shows the application starts up fine with no errors; however, the browser displays the following error page:</p>
  
  <blockquote>
    <p>Whitelabel Error Page</p>
    
    <p>This application has no explicit mapping for /error, so you are seeing
    this as a fallback.</p>
  </blockquote>
  
  <p>[I understand the message says no mapping for '/error' url. However I want to know the root cause ]</p>
  
  <p><strong>Additional Info/Context</strong></p>
  
  <ul>
  <li>Spring boot 1.4.2</li>
  <li>docker plugin</li>
  <li>Output is 'war' file which also runs standalone</li>
  <li>I run docker image in 'host' networking mode (--net=host) so it can access the database (mysql running on my localhost)</li>
  </ul>
  
  <p><strong>build.gradle target</strong></p>
  
  <pre><code>task buildDocker(type: Docker, dependsOn: build) {
    push = false
    applicationName = jar.baseName
    dockerfile = file('src/main/docker/Dockerfile')
    doFirst {
      copy {
        from war
        into stageDir
      }
    }
  }
  </code></pre>
  
  <p><strong>dockerfile</strong></p>
  
  <pre><code>FROM frolvlad/alpine-oraclejdk8:slim
  VOLUME /tmp
  ADD floss.war app.jar
  RUN sh -c 'touch /app.jar'
  ENV JAVA_OPTS=""
  ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
  </code></pre>
  
  <p><strong>Command to Run Docker</strong></p>
  
  <pre><code>dockerImg=1248c47d9cfa
  docker run \
         -it \
         --net=host \
         -e SPRING_APPLICATION_JSON="$SPRING_APPLICATION_JSON" \
         $dockerImg
  </code></pre>
  
  <p>I'm new to docker and would appreciate any suggestions.</p>
  
  <p>thanks in advance!</p>