Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Jprofile connect to JVM running in docker

I'm new to JProfiler. I came into a problem recently. My Java app is running in docker which means the JVM is runnning in docker. But my jprofile is installed in the host machine. I know the jprofiler must connect to a JVM. So, is there anyway that the jprofiler can connect to jvm running in docker?

like image 426
shawn Avatar asked Aug 09 '16 19:08

shawn


2 Answers

It is similar as connects JProfiler to a remote JVM, you just need to have the JProfiler agent ready inside your container and expose the port.

This post has a step by step guide http://geekspearls.blogspot.com.au/2016/08/configure-jprofiler-92-to-profiling.html

like image 175
Andrew Liu Avatar answered Sep 29 '22 02:09

Andrew Liu


You can use this dockerfile; https://registry.hub.docker.com/u/gingerbeard/java8-jprofiler/dockerfile/

FROM dockerfile/java:oracle-java8
MAINTAINER gingerbeard <[email protected]>

RUN wget http://download-aws.ej-technologies.com/jprofiler/jprofiler_linux_8_1_2.tar.gz -P /tmp/ &&\
 tar -xzf /tmp/jprofiler_linux_8_1_2.tar.gz -C /usr/local &&\
 rm /tmp/jprofiler_linux_8_1_2.tar.gz

ENV JPAGENT_PATH="-agentpath:/usr/local/jprofiler8/bin/linux-x64/libjprofilerti.so=nowait"
EXPOSE 8849

CMD ["bash"]

make sure to check the ports.

like image 39
Patrick Aleman Avatar answered Sep 29 '22 02:09

Patrick Aleman