Cannot Attache Debugger with Docker
Answered
Hi,
I got Docker to work (it deploys the docker file and I can make a call to my Spring beans application), but I cannot get debugging to work.
I am trying to follow https://www.jetbrains.com/help/idea/debug-a-java-application-using-a-dockerfile.html but I am now getting 'Failed to deploy 'monolith-repo Dockerfile: Dockerfile': Status 500: Ports are not available:'. Note I am running against port 8000 since I am using spring boot and per https://www.baeldung.com/spring-debugging the debug port is 8000 . See attached for how I set up Docker and the Debug configuration:
If I include the 8000:8000 mapping I get the error 'Failed to deploy 'monolith-repo Dockerfile: Dockerfile': Status 500: Ports are not available: /forwards/expose/port returned unexpected status: 500'.
I get 'Error running 'Remote-For-Docker': Unable to open debugger port (localhost:8000): java.io.IOException "handshake failed - connection prematurally closed"' if I do not include the 8000:8000 mapping.
Does anyone know what I can try to fix this?
Please sign in to leave a comment.
See the thread with the same problem here: https://youtrack.jetbrains.com/issue/IDEA-242919