Java APM with Docker
  • Updated on 07 Nov 2019
  • 1 minute to read
  • Contributors
  • Print
  • Share
  • Dark

Java APM with Docker

  • Print
  • Share
  • Dark

This document details how to install the Java APM Profiler in your Java application running on Docker or Docker Swarm.


Follow the Retrace Docker Install Guide.

Java Docker Setup

Dockerfile Configuration

Adjust your Dockerfile to include the Java Profiler:

RUN mkdir -p /stackify-java-apm && \
    cd /stackify-java-apm && \
    wget; tar -zxvf  stackify-java-apm-latest.tar.gz; rm stackify-java-apm-latest.tar.gz && \

Enabling the Java Agent

Follow Enable the Stackify Java Profiler instructions based on the application server being used.

Note: Adjust the Java Profiler path to: /stackify-java-apm/stackify-java-apm.jar.

Running your Application

Start your application with the stackify shared volume

docker run -v stackify:/usr/local/stackify [your-application-image] 


Make application requests, you can then verify results in the Retrace dashboard.


  • Running in Docker Swarm requires that STACKIFY_DOCKER_ENABLED be set when running your application. This can be done using -DSTACKIFY_DOCKER_ENABLED=true.
Was this article helpful?