Skip to content

Docker Profiling

Pro Feature

Docker profiling requires a Pro license.

Profile Java applications running in local Docker containers with automatic discovery.


GalataJ automatically discovers Java applications running inside Docker containers on your local machine.

  1. Start your Docker container with a Java application
  2. Open the Profiler panel in your IDE
  3. Click Refresh — Docker containers appear in the JVM list
  4. Select the container and start profiling

No configuration needed. GalataJ handles the connection automatically.

JDK recommended for automatic attach

If your container uses a JDK image, GalataJ attaches automatically with zero configuration. If your container uses a JRE or a JDK without attach support, you can still profile using the -javaagent approach. See Alternative: Using -javaagent below.


GalataJ finds Java processes running in:

  • Docker Desktop (Windows/macOS)
  • Docker Engine (Linux)
  • Docker Compose projects

As long as the container is running on your local machine, GalataJ can profile it.


In the JVM list, Docker containers show:

  • Container name — The name you gave the container
  • Image name — The Docker image being used
  • Container ID — Short ID for identification

If automatic attach doesn’t work — for example, your container uses a JRE image or a JDK that doesn’t support runtime attach — you can load the profiler agent at startup using -javaagent. This works with any Java image, including JRE.

Choose one of the following options:

Add the following to your service definition — no Dockerfile changes needed:

services:
my-app:
# ... your existing config ...
volumes:
- ~/.galataj/agent/agent.jar:/opt/galataj-agent.jar:ro
environment:
- JAVA_TOOL_OPTIONS=-javaagent:/opt/galataj-agent.jar
- GALATAJ_PACKAGE=com.mycompany.myapp
extra_hosts:
- "host.docker.internal:host-gateway"

Then restart your services:

Terminal window
docker compose up

Copy the agent JAR into your project directory:

Terminal window
cp ~/.galataj/agent/agent.jar ./agent.jar

Then add these lines to your Dockerfile before the ENTRYPOINT:

COPY agent.jar /opt/galataj-agent.jar
ENV JAVA_TOOL_OPTIONS="-javaagent:/opt/galataj-agent.jar"
ENV GALATAJ_PACKAGE=com.mycompany.myapp

No file changes needed — pass volume mount and environment flags directly:

Terminal window
docker run \
-v ~/.galataj/agent/agent.jar:/opt/galataj-agent.jar:ro \
-e JAVA_TOOL_OPTIONS="-javaagent:/opt/galataj-agent.jar" \
-e GALATAJ_PACKAGE=com.mycompany.myapp \
--add-host=host.docker.internal:host-gateway \
your-image
  • Replace com.mycompany.myapp with your application’s base package (e.g., the package containing your @SpringBootApplication class).
  • On Linux, the extra_hosts (Compose) or --add-host (docker run) flag is required so the container can reach the host. The examples above already include this.
  • When using the IDE wizard, the generated snippet already has the correct package filled in.

Local Only

GalataJ can only profile Docker containers running on your local machine. Remote Docker hosts (SSH, remote Docker API) are not currently supported.


  1. Make sure the container is running (not stopped)
  2. Click Refresh in the profiler panel
  3. Verify the container has a Java process inside
  4. Run Health Check to ensure GalataJ is working
  1. Make sure you have a Pro license activated
  2. Check that Docker is running on your machine
  3. Try restarting your IDE

Attach failed: jdk.attach not available

If you see errors like:

  • “jdk.attach module not available in container”
  • “The container image must include JDK (not just JRE)”
  • “NoClassDefFoundError: com/sun/tools/attach/AttachNotSupportedException”

the container is using a JRE image or a JDK without attach support.

Solution A — Switch to a JDK image:

# Before (fails for automatic attach)
FROM eclipse-temurin:17-jre
# After (works with GalataJ)
FROM eclipse-temurin:17-jdk

Recommended JDK images: eclipse-temurin:17-jdk, amazoncorretto:17, azul/zulu-openjdk:17.

Rebuild the image and run the container again, then start profiling.

Solution B — Use -javaagent instead:

If you can’t switch to a JDK image, use the -javaagent approach which works with any Java image including JRE. See Alternative: Using -javaagent above.


Upgrade to Pro

Get Docker profiling and more

Upgrade →

Session History

Compare container performance over time

Learn more →