欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

docker.maven.plugin插件出错:Could not acquire image ID or digest following build

程序员文章站 2024-03-12 22:12:26
...

项目之前构建很正常,但是加入了.dockerignore 文件(内容如下)之后,就出现该问题(项目名用project_name 代替):

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (default-cli) on project project_name: Exception caught: Could not acquire image ID or digest following build -> [Help 1]

.dockerignore 文件内容:

*
!target/project_name.jar

经过各种尝试无果,最后发现在.dockerignore 中加入一行解决问题:

*
!target/laputa-upms-biz.jar
!Dockerfile

其含义是不排除Dockerfile

参考: https://github.com/spotify/dockerfile-maven/issues/282