Remote debugging of containers running on host network

Viewed 11

I was running the container as mentioned below. Port 5005 was exposed for Intellij's remote debugging.

docker run -d -p 8080:8080 -p 5005:5005 --network=my_network --env "JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n"" container_name:latest

Due to some reasons now I have to run the container on host network which looks like this

docker run -d --network=host --env "JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n"" container_name:latest

Since there is no port mapping allowed on the host network, how is it possible to expose port 5005 for remote debugging?

0 Answers
Related