Is this a BUG REPORT or FEATURE REQUEST?:
[Add feature/bug description here]
[Add steps on how to reproduce this issue]
[Describe what do you expect to happen]
[Describe the actual results]
docker version: [Add the output of docker version here, both client and server][Paste full backtrace here]
I have the same message on Windows 10 :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.10:build (default) on project POA-Server: Execution default of goal com.spotify:dockerfile-maven-plugin:1.4.10:build failed: Could not acquire image ID or digest following build
Maven version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00)
Maven home: C:\Program Files (x86)\Apache\maven\bin\..
Java version: 10.0.1, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk-10.0.1
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Docker version
18.06
I test with 1.4.9 version, it's works fine.
I'm facing the same issue on my Win10 workstation whereas it works perfectly on my personal Macbook.
I tried downgrading the dockerfile plugin back to 1.4.6 - 1.4.9 but 1.4.10 is required to be able to use a docker file from a specific path, eg "target/docker/base/dockerfile_base" (which meets my need).
any idea ?
I confirmed, it's works fin on Mac OS with 1.4.10.
I am having this problem as well. I am running 1.4.10 on Win10. If i leave my Dockerfile in the project root it works fine. If i relocate it to a subdirectory and specify <dockerfile> in my pom.xml, i get this error.
Maybe your Dockerfile was ignored. Add !Dockerfile in your .dockerignore will work fine.
I am having this problem as well. I am running 1.4.10 on Win10. If i leave my Dockerfile in the project root it works fine. If i relocate it to a subdirectory and specify
<dockerfile>in my pom.xml, i get this error.
Are there any plans to fix this problem? Is there a workaround?
Same problem for Windows, Mac works perfectly fine. Any fix coming?
From the readme file:
At this point, we're not developing or accepting new features or even fixing non-critical bugs.
I don't believe this is going to be fixed.
I moved the Dockerfile to the same directory with pom.xml and it works
Sure. But that's not what I want. I want to use the same context directory, but with different Dockerfiles for each build profile.
We have recently had this issue and it was due to our repository tag containing capital letters. When removing them, the build succeeds.
I moved Dockerfile to project root directory, and then the Docker build worked.
For a further test, I then upper cased the repository tag, which resulted in a different error stating that lower case is required:
Repo name "DOCKER.PREFIX/configurationserver" must contain only lowercase, numbers, '-', '_' or '.'. -
The point is that an upper case repository tag did not drive the bug about "Could not acquire image ID or digest following build".
I guess we're stuck with placing Dockerfile in the project root directory.
dockerfile feature work fine, do it like this:
directory like this (generate by tree -L 2):
.
โโโ docker
โย ย โโโ Dockerfile
โโโ kubernetes
โย ย โโโ development.yaml
โย ย โโโ service.yaml
โโโ mvnw
โโโ mvnw.cmd
โโโ pom.xml
โโโ README.md
โโโ src
โโโ main
โโโ test
pom.xml like this:
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.10</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<dockerfile>docker/Dockerfile</dockerfile>
<repository>${docker.repository}/${project.artifactId}</repository>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
Sure. But that's not what I want. I want to use the same context directory, but with different Dockerfiles for each build profile.
see my previous reply
i am facing the same issue.I have my "DockerFile" in my project root directory,and the message like this.Then i refactor the "DockerFile" to "Dockerfile",and it build succeeds.
For me, it turned out to be a syntax error in my Dockerfile.
I have got the same issue with my build failing on Windows. I figured out that it was failing due to the push goal whereas the build goal alone was successful
After investigating (mvn -X), this seems to be the docker-credential-desktop command that is blocking when run by mvn. If I run it manually (echo mydockerrepository.com | docker-credential-desktop get) it is successful. So I bet that the problem may be in the way the credentials are retrieved by the plugin (or by the underlying library).
I got the same problem when I got two dashes in the artifactId, for instance "cdi-bundle-a", when I change the artifactId to "cdi-bundlea" it works fine.
BTW I was assigned the artifactId to the image name:
<imageName>${project.artifactId}</imageName>
Hope this helps!
I saw the same error when <entryPoint> element is splitted by more than one line.
Probably you have specified a name for your image to be build with a uppercase letter in it.
Try to specify that < contextdirectory > is the directory where the dockerfile is located
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
finally locate the problem. My configuration:
I've verifed this by debug run mvn build and modify the related logic, and it can successfully build.
----modify dockerfile buldParameter from 'srcmaindockerDockerfile' to 'src/main/docker/Dockerfile'
https://github.com/spotify/dockerfile-maven/blob/63496523c549369be42fdc13ab4a581cff469257/plugin/src/main/java/com/spotify/plugin/dockerfile/BuildMojo.java#L176
so maybe I can conclude that dockerfile config cannot be used in such situation. and we have to use maven-resources-plugin to copy all file to some place to get rid of this config.
unless somebody delete the dockerfile config tranformation logic, and use it as it is.
I encountered this problem on my Mac with docker desktop. There is a disk image size under preferences->resources->advanced. The capacity of all my local images is already larger than this setting. So, when I clean up all local images, the build succeeds.
Most helpful comment
I am having this problem as well. I am running 1.4.10 on Win10. If i leave my Dockerfile in the project root it works fine. If i relocate it to a subdirectory and specify
<dockerfile>in my pom.xml, i get this error.