When I have running Docker container directly at my host, it is possible to connect to it without any problems.
My host has network 192.168.1.0/24 and IP address of
If anyone has problems with it. I have started the java process in the docker container with the following parameters:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9876
-Dcom.sun.management.jmxremote.rmi.port=9876
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=
The important part is to set the name of the docker container. EXPOSE the port in the container 9876. I have also setup an ssh connection and forwarded 9876 to the localhost.
The following goes to your SSH config:
LocalForward 127.0.0.1:9876 127.0.0.1:9876
Also I have setup /etc/hosts on the local machine
127.0.0.1
Now connect your console to "name of the docker container"