英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论