1 回答
TA贡献2041条经验 获得超4个赞
这是dockerfile-maven-plugin配置:
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-plugin.version}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>${project.artifactId}</repository>
<tag>${project.version}</tag>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
注意:使用最新发布的版本1.4.7
这将插件配置为使用单个命令构建和推送您的图像:
$ mvn clean deploy
如果您只想构建 Docker 镜像,请运行:
$ mvn clean package
添加回答
举报