Skip to content

Instantly share code, notes, and snippets.

@jjylik
Last active September 15, 2018 09:33
Show Gist options
  • Save jjylik/c9b791e98d49952cfb95cef413a44bad to your computer and use it in GitHub Desktop.
Save jjylik/c9b791e98d49952cfb95cef413a44bad to your computer and use it in GitHub Desktop.
Async profiler container
FROM openjdk:8-jdk-slim
RUN apt-get update && \
apt-get install -y curl && \
apt-get install -y --no-install-recommends linux-perf && \
ln -s /usr/bin/perf_* /usr/bin/perf && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
mkdir /async-profiler && \
curl -L -s https://github.com/jvm-profiling-tools/async-profiler/releases/download/v1.4/async-profiler-1.4-linux-x64.tar.gz | tar xvfz - -C /async-profiler && \
WORKDIR /async-profiler
ENTRYPOINT ["/async-profiler/profiler.sh"]
docker run -it --privileged --rm --pid container:$CONTAINER_ID --network container:$CONTAINER_ID $PERF_IMAGE -d 10 -i 10000us -f $OUTPUT_FILE $JAVA_PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment