Is it possible to configure docker image name/tag for Quarkus build inside build.gradle (instead of passing properties)

huangapple go评论56阅读模式
英文:

Is it possible to configure docker image name/tag for Quarkus build inside build.gradle (instead of passing properties)

问题

要配置构建的镜像,我可以使用https://quarkus.io/guides/container-image#container-image-options中提到的属性,但是它们要求我在调用构建时传递它们,例如:

./gradlew clean build \
    -Dquarkus.container-image.build=true \
    -Dquarkus.container-image.tag=latest

是否有一种方法可以在build.gradle或周围的属性中配置这些值,类似于bmuschko / jib插件提供的方式?

英文:

To configure the built image I can use properties mentioned in https://quarkus.io/guides/container-image#container-image-options, however they require me to pass them when I invoke the build e.g.

./gradlew clean build \
    -Dquarkus.container-image.build=true \
    -Dquarkus.container-image.tag=latest

Is there a way to configure these values in build.gradle / surrounding properties, in a fashion similar to what bmuschko / jib plugins provide?

答案1

得分: 0

我找到了一种简单的方法,只需执行与“-D”相同的操作即可:

System.setProperty("quarkus.container-image.build", "true");
System.setProperty("quarkus.container-image.tag", "potato");

将这段代码放在build.gradle中,但它看起来不像使用bmuschko / jib插件那样的正确配置。

英文:

I found a hacky way by simply doing the same thing that -D does:

System.setProperty("quarkus.container-image.build", "true")
System.setProperty("quarkus.container-image.tag", "potato")

put inside build.gradle, but it does not look like proper configuration like with bmuschko / jib plugins.

huangapple
  • 本文由 发表于 2023年6月2日 06:59:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76386201.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定