title: How to run undertow java app with docker
body: <p>I am using undertow for my applications with docker.</p>
  
  <p>I am able to do the following</p>
  
  <ol>
  <li><p>create fat jar</p></li>
  <li><p>create docker image from that </p></li>
  <li><p>Run that docker image</p></li>
  <li><p>Listing on 8080 and added EXPOSE 8080 in Docker file</p></li>
  <li><p>curl my url from INSIDE the CONTAINER , curl localhost:8080/sample</p></li>
  </ol>
  
  <p>I am facing some weird problem, </p>
  
  <p>And My compose file is</p>
  
  <pre><code>version: '2'
  services:
    login:
      image: my-image
      ports:
       - "8080:8080"
  </code></pre>
  
  <p>with 8080 port I am not able to access the url. </p>
  
  <p>My Dockerfile</p>
  
  <pre><code>FROM openjdk:8-jre
  COPY ./target/*-with-dependencies.jar /jars/service-jar.jar
  EXPOSE 8080
  CMD java  -cp /jars/service-jar.jar my.Main 
  </code></pre>
  
  <p>My Undertow Listener </p>
  
  <pre><code>Undertow server = Undertow.builder()
          .addHttpListener(8080, "localhost")
          .setHandler(path)
          .build();
  </code></pre>
  
  <p>I got some link in google still not able to make it work</p>
  
  <p><a href="http://lists.jboss.org/pipermail/undertow-dev/2014-October/000999.html" rel="nofollow noreferrer">http://lists.jboss.org/pipermail/undertow-dev/2014-October/000999.html</a> </p>