dockerenvironment-variableszipkin

Increase Java HeapSpace in Zipkin Docker Container


I am using a docker command to run zipkin and increase the heap space. The command I am using is:

docker run \
-e JAVA_OPTS="Xms1g -Xmx1g -XX:+ExitOnOutOfMemoryError" \
--name zipkin -p 2005:9411 -d openzipkin/zipkin:latest

The output is :

17b2f1a0e8bf5129a527318f01463ea16f3aef8fb4b229f9693bceb17e12ad59

This means the image is getting created. But the error appears on log:

Error: Could not find or load main class Xms1g

Caused by: java.lang.ClassNotFoundException: Xms1g

How to resolve. Please help.

I am using MacOS with m1 chip.


Solution

  • There is a typo in your command.

    This one works OK.

    docker run \
    -e JAVA_OPTS="-Xms1g -Xmx1g -XX:+ExitOnOutOfMemoryError" \
    --name zipkin -p 2005:9411 -d openzipkin/zipkin:latest
    

    You need to add an - before Xms1g