【发布时间】:2021-07-05 02:44:06
【问题描述】:
使用jib-maven-plugin 我想构建一个带有多个标签的图像。虽然mvn jib:build 基本上可以正常工作,但它“只”用latest 标记图像。
我的 Maven pom.xml 定义如下:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>2.8.0</version>
<configuration>
<to>
<image>my-private-registry.org/my-image</image>
</to>
</configuration>
</plugin>
The docs 表明可以在 XML 中使用jib.to.tags 来定义标签列表。但是,我想在 Jenkins 管道中运行构建步骤,即我无法对 pom.xml 中的标签进行硬编码。
是否可以在运行mvn 命令时传递标签列表,例如通过设置一些-D 参数?
【问题讨论】: