I have a Docker container based on opendjdk:8-slim with installed Tomcat 9 and I am debugging apps deployed there from my IDE (IntelliJ) - the IDE runs on Docker host. I run the Tomcat with the following configuration
CATALINA_OPTS="-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=49520 \
-Dcom.sun.management.jmxremote.rmi.port=49520 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.local.only=false \
-Djava.rmi.server.hostname=10.0.75.1 \
-agentlib:jdwp=transport=dt_socket,address=49540,suspend=n,server=y"
Everything works great - I can attach the IDE to the container. Also the following command works (executed from docker host) - it can connect to the process in the container (the port 49540 in the container is mapped to the port 49540 on the host):
docker-host$ telnet localhost 49540
Now I want to upgrade to Java 9. I changed the base image from openjdk:8-slim to openjdk:9-slim and I can't connect to the debugger port from the docker host. Also from IDE, I got SocketTimeoutException: Connection reset. However, from inside the container I am able to connect to the debugger via telnet.
I tried several images of Java 9 from openjdk repository and also from other repos, for example adenix/java, but unfortunately with the same result.