如何在 docker-compose 中运行多个 JVM 参数?

Jak*_*sić 4 parameters jvm docker docker-compose

我从以下答案中获取了 JVM 参数列表/sf/answers/2457628211/

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
Run Code Online (Sandbox Code Playgroud)

我想在 docker-compose 中运行它们。

这是我尝试过的:

environment:
  - JAVA_TOOL_OPTIONS="-Dcom.sun.management.jmxremote"
  - JAVA_TOOL_OPTIONS="-Dcom.sun.management.jmxremote.port=9010"
  - JAVA_TOOL_OPTIONS="-Dcom.sun.management.jmxremote.local.only=false"
  - JAVA_TOOL_OPTIONS="-Dcom.sun.management.jmxremote.authenticate=false"
  - JAVA_TOOL_OPTIONS="-Dcom.sun.management.jmxremote.ssl=false"
Run Code Online (Sandbox Code Playgroud)

但它不起作用。

我该怎么做?

Jak*_*sić 5

最终,我设法找到了解决方案。

这里是:

environment:
    - JAVA_TOOL_OPTIONS=
        -Dcom.sun.management.jmxremote
        -Dcom.sun.management.jmxremote.port=9010
        -Dcom.sun.management.jmxremote.local.only=false
        -Dcom.sun.management.jmxremote.authenticate=false
        -Dcom.sun.management.jmxremote.ssl=false
Run Code Online (Sandbox Code Playgroud)