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/AMD64forPlatform of the remote computeron 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).
@harishcholleti Is it CentOS? Sorry I don't use CentOS or any Red Hat ones.
So I'm not sure if I'm the right one to ask but it looks like
wgetis not installed which is really weird.I think it's more likely that
wgetis not in thePATH. Could you trywhich wgetand get the path and use it or add the path to thePATHenv var?The simplest solution might be putting the following line in your
Dockerfile.RUN export PATH=$PATH:$(dirname $(which wget))I'm not so sure if you need to use
ENVinstead ofRUNbut you can try both.I don't need to set up
Dockerfilethese days so I forgot the things that were familiar before.