Skip to content

Instantly share code, notes, and snippets.

@gilbertolptn
Created June 8, 2020 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilbertolptn/304c5b738b2e0a405893fc04623273e5 to your computer and use it in GitHub Desktop.
Save gilbertolptn/304c5b738b2e0a405893fc04623273e5 to your computer and use it in GitHub Desktop.
docker run -d --restart=always
\
-p {{service_port}}:8080

-p {{jmx_port}}:{{jmx_port}}
\
-e JAVA_OPTS='
    -Xmx{{java_memory_limit}}
   -XX:+UseConcMarkSweepGC
    -XX:NativeMemoryTracking=summary
    -Djava.rmi.server.hostname={{ansible_default_ipv4.address}}

    -Dcom.sun.management.jmxremote

    -Dcom.sun.management.jmxremote.port={{jmx_port}}

    -Dcom.sun.management.jmxremote.rmi.port={{jmx_port}}

    -Dcom.sun.management.jmxremote.local.only=false

-Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.ssl=false
'
    \
   -m={{container_memory_limit}}
   --memory-swap={{container_memory_limit}}
    \
    --name {{service_name}}
   \
    {{private_registry}}/{{image_name}}:{{image_version}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment