DockerFile should have JProfiler installation.
RUN wget <JProfiler file location> -P /tmp/ && \
tar -xzf /tmp/<JProfiler file> -C /usr/local && \
rm /tmp/<JProfiler file>
EXPOSE <port>
e.g.)
RUN wget http://download-aws.ej-technologies.com/jprofiler/jprofiler_linux_9_2.tar.gz -P /tmp/ && \
tar -xzf /tmp/jprofiler_linux_9_2.tar.gz -C /usr/local &&\
rm /tmp/jprofiler_linux_9_2.tar.gz
EXPOSE 8849
docker run -p <port>:<port> your-docker
e.g.)
docker run -p 8849:8849 your-docker
java -jar my-app.jar -agentpath:/usr/local/jprofiler9/bin/linux-x64/libjprofilerti.so=port=<port>
e.g.)
java -jar my-app.jar -agentpath:/usr/local/jprofiler9/bin/linux-x64/libjprofilerti.so=port=8849
So in the DockerFile
, it looks like
ENTRYPOINT ["java -jar","my-app.jar",
"-agentpath:/usr/local/jprofiler9/bin/linux-x64/libjprofilerti.so=port=8849"]
- Select '
Profile an application server, locally or remotely
'. - If the target application is running on any specific server listed, select it. Otherwise, choose
Generic application
. - Select
Linux X86/AMD64
forPlatform of the remote computer
on a remote computer. - Select the JVM used in the Docker instance.
- To make JProfiler to wait for the application to start and send data, select
Wait for a connection from the JProfiler GUI
. - Enter the remote address to the
Remote address
. If it's Docker for Mac, it islocalhost
. If Docker Machine is used, use the IP of the Docker Machine. - Add the path to the JProfiler on the Docker where the jar file metioned above is using to the
Remote installation directory
. It looks like/usr/local/jprofiler<version>
. e.g.) /usr/local/jprofiler9 - Set the port number or use the default (i.e. 8849).
I've spent hours figuring out how to do this. Thank you!