I'm trying to create a docker image with tomcat and JMX activated.

So I clone this tomcat docker image https://github.com/tutumcloud/tutum-docker-tomcat. I exposed the port 1099 and edited the run script as follow:


if [ ! -f /.tomcat_admin_created ]; then

export CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false" 
exec ${CATALINA_HOME}/bin/catalina.sh run

At the moment I don't really consider security, I just trying to have a JMX available.

Next a build the image docker build -t <name> and run it docker run -d -p 8080:8080 -p 1099:1099 <name>

Container is correctly launched and port forward:>1099/tcp,>8080/tcp

And port is open telnet 1099. I use because I'm on macos with boot2docker, and is boot2docker ip.

But when I'm trying to connect to JMX via jconsole I get a timeout..


I found the solution..

I must declare -Djava.rmi.server.hostname=

| improve this answer | |
  • That's because you use Boot2docker. – JRun Jul 15 '15 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.