title: Debugging Tomcat in Docker container
body: <p>I have a CoreOS running in Vagrant. Vagrant private network IP is 192.168.111.1. Inside a CoreOS is a docker container with Tomcat 8.0.32. Pretty much everything works ok (app deployment etc.) just debugging does not. Tomcat is mapped to 8080 port and the JPDA port should be 8000.</p>
  
  <h2>Facts</h2>
  
  <p>Tomcat JPDA is configured with:</p>
  
  <pre><code>JDPA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
  </code></pre>
  
  <p>It starts with <code>catalina.sh jpda start</code> command. The output in the console when running it with <code>docker-compose</code> is:</p>
  
  <pre><code>tomcat | Listening for transport dt_socket at address: 8000
  </code></pre>
  
  <p>From the container info I assume that ports are mapped as they should:</p>
  
  <pre><code>CONTAINER ID        IMAGE       COMMAND      CREATED             STATUS              PORTS                                            NAMES
  dcae1e0148f8        tomcat      "/run.sh"    8 minutes ago       Up 8 minutes        0.0.0.0:8000-&gt;8000/tcp, 0.0.0.0:8080-&gt;8080/tcp   tomcat
  </code></pre>
  
  <p>My docker image is based on this <a href="https://github.com/pietvandongen/docker-tomcat-development" rel="noreferrer">Dockerfile</a>.</p>
  
  <h2>Problem</h2>
  
  <p>When trying to run Remote debug configuration (screenshot below) I get the error <code>Error running Debug: Unable to open debugger port (192.168.111.1:8000): java.net.ConnectException "Connection refused"</code>. I've tried everything from changing various configuration but no luck. Am I missing something?</p>
  
  <p><a href="https://i.stack.imgur.com/M3m4Z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/M3m4Z.png" alt="enter image description here"></a></p>