对于在 CI 运行器上使用 com.spotify:dockerfile-maven-plugin 构建的多模块 maven 项目,dockerfile:build dockerfile:tag
在上一步中构建 docker 映像并在部署步骤中运行mvn clean deploy dockerfile:push
会导致错误:
Failed to execute goal com.spotify:dockerfile-maven-
plugin:VERSION:tag (default-cli) on project PROJECT_NAME: Execution
default-cli of goal com.spotify:dockerfile-maven-plugin:VERSION:tag
failed: path is 'null'.
日志:
Tagging image null as REPO_NAME/IMAGE_NAME
显然,构建的图像没有被正确标记。
pom.xml
:
<configuration>
<repository>${prefix}/${project.artifactId}</repository>
<tag>${tag}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>false</skip>
</configuration>
但我真的找不到我做错了什么。