通过远程debugging器连接Docker容器

我正在尝试使用JConsole或JVisualVM连接我的Docker容器。 有一些文章,我喜欢http://www.jamasoftware.com/blog/monitoring-java-applications/,但这并不适用于我。

我如何将它们连接到我正在运行的容器。 我使用最新的docker为Mac,所以我没有docker机IP为192.168.99.100

尝试设置-Djava.rmi.server.hostname=localhost以及其他rmi / jmx参数。

 -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=localhost