title: Intellij Debug Docker container keeps giving me IO Exception Handshake Failed
body: <p>I am trying to setup a remote debugger in Intellij v2020.1, I keep getting the error below:</p>
  <p>Unable to open debugger port (localhost:5005): java.io.IOException &quot;handshake failed - connection prematurally closed&quot;</p>
  <p>In my docker compose file I have mounted port 5005 to 5005</p>
  <p>In my docker file i have:</p>
  <p><code>EXPOSE 5005 </code></p>
  <p><code>ENTRYPOINT [&quot;/bin/bash&quot;, &quot;runme.sh&quot;]</code></p>
  <p>and in my shell script I have:</p>
  <p><code>/opt/java/openjdk/bin/java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar mine.jar</code></p>
  <p>When I do a docker ps, i can see the below:</p>
  <p><code>0.0.0.0:5005-&gt;5005/tcp, 0.0.0.0:8111-&gt;8111/tcp</code></p>
  <p>In IntelliJ I setup the remote debugger from port 5005 to contaier port 5005, added in the module claspath and in the before launch step, added in my compose file.</p>
  <p>The service starts up fine, but jut cant connect to the debugger, any ideas?</p>