Skip to content
Advertisement

Docker and jre 11 in Debug mode

I was trying to get a remote debug session running on my docker container.

Actually the debug session always gets blocked by an IOException..

Dockerfile Entrypoint:

ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom", "-Xdebug", "-agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=n", "-jar","/backend.jar"]

Any ideas, whats wrong with this?

Advertisement

Answer

since java 9 you have to specify your adapter, or simply use an escaper for the debug host as such:

-agentlib:jdwp=transport=dt_socket,server=y,address=*:5005,suspend=n
vs old (pre java 9)

-agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=n

great documentation in openjdk btw..

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement