使用jib构建docker镜像时如何指定多个jvm参数?

问题描述 投票:0回答:1

使用 jib 设置多个 jvm 参数构建 docker 镜像

quarkus.jib.jvm-additional-arguments=-XX:InitialRAMPercentage=50, -XX:MaxRAMPercentage=90

抛出错误并阻止容器运行。

Error: Could not find or load main class  -XX:InitialRAMPercentage=50
Caused by: java.lang.ClassNotFoundException: -XX:InitialRAMPercentage=50

我使用以下属性使用 jib 构建 Quarkus 应用程序:

quarkus.jib.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-17:1.19-1

quarkus.jib.jvm-arguments=-Djava.net.preferIPv4Stack=true

quarkus.jib.jvm-additional-arguments=-XX:InitialRAMPercentage=50, -XX:MaxRAMPercentage=90

我想使用多个 jvm 参数,但这会在我尝试运行容器时导致以下错误:

Error: Could not find or load main class  -XX:InitialRAMPercentage=50
Caused by: java.lang.ClassNotFoundException: -XX:InitialRAMPercentage=50

在映像构建过程中,使用两个附加 jvm 参数正确设置容器入口点。

当我手动构建容器时

docker built -t x/y .

不会出现上述错误。

java docker shell quarkus jib
1个回答
0
投票

改变:

quarkus.jib.jvm-additional-arguments=-XX:InitialRAMPercentage=50, -XX:MaxRAMPercentage=90

进入

quarkus.jib.jvm-additional-arguments="-XX:InitialRAMPercentage=50 -XX:MaxRAMPercentage=90"

PS:您错过了参数周围的引号。另外我认为,我可能是错的,你应该删除

,

© www.soinside.com 2019 - 2024. All rights reserved.