Search code examples
javaeclipsedockerportremote-debugging

Connecting Eclipse to Docker Container for Remote Debugging


I'm trying to connect eclipse to a docker container I have running but I am having trouble.

My docker run command is as follows:

docker run --rm -it -p 8000:8000 -p=8668:8080 -p 8010:8009 -p 8443:8443 \
--name myContainer -h theContainer -e JVM_ROUTE=myContainer1 myContainer:qa

In eclipse, I'm connecting with localhost as the host, and 8000 as the port. I go to Run->Debug Configurations->Remote Java Application, and I've created a new debug configuration.

my project debugging

When I click apply, then debug, I get a pop up error message Failed to connect to remote VM.

cant connect

What else do I need to do to get remote debugging working properly?


Solution

  • This was solved by replacing localhost with my actual IP address.