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).
Seeing an issue with wget command not found with the below script. Any suggestions?
FROM
RUN wget http://XXXXXXXXX/jprofiler-local/jprofiler_linux_7_1_1.tar -P /tmp/ &&
tar -xzf /tmp/jprofiler_linux_7_1_1.tar -C /usr/local &&
rm /tmp/jprofiler_linux_7_1_1.tar
EXPOSE 8849
Log
Step 2/3 : RUN wget http://XXXXXXXX/jprofiler-local/jprofiler_linux_7_1_1.tar.tar -P /tmp/ && tar -xzf /tmp/jprofiler_linux_7_1_1.tar.tar -C /usr/local && rm /tmp/jprofiler_linux_7_1_1.tar
---> Running in b70b5809d810
"/bin/sh: wget: command not found"
Otherway,
I tried adding the "Step 2:RUN yum -y install wget" before RUN Wget then seeing a connection timeout issue.
http://192.18.10.29/yum/docker/dockerrepo-oel7/repodata/repomd.xml: [Errno 12] Timeout on http://192.17.10.29/yum/docker/dockerrepo-oel7/repodata/repomd.xml: (28, 'Connection timed out after 30006 milliseconds')