Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"failed to read dockerfile" error with submodules, dockerfiles and buildx #1562

Closed
spmason opened this issue May 30, 2022 · 1 comment · Fixed by #1564
Closed

"failed to read dockerfile" error with submodules, dockerfiles and buildx #1562

spmason opened this issue May 30, 2022 · 1 comment · Fixed by #1564

Comments

@spmason
Copy link

spmason commented May 30, 2022

Description

I have a reasonably complicated project that uses Maven submodules and Dockerfiles for builds. This works fine without the new buildx configuration but breaks using it. It crashes out with the following error:

[INFO] DOCKER> WARNING: No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
[INFO] DOCKER> WARNING: local cache import at ......./dmp-buildx-bug/module1/target/docker/dmp-buildx-bug/cache not found due to err: could not read ....../dmp-buildx-bug/module1/target/docker/dmp-buildx-bug/cache/index.json: open ....../dmp-buildx-bug/module1/target/docker/dmp-buildx-bug/cache/index.json: no such file or directory
[INFO] DOCKER> error: failed to solve: failed to read dockerfile: open /tmp/buildkit-mount3293280157/Dockerfile: no such file or directory
[INFO] DOCKER> docker --config ....../dmp-buildx-bug/module1/target/docker/dmp-buildx-bug/docker buildx rm dmp_dmp-buildx-bug

I've simplified my config into a repo that can reproduce the issue with a simple mvn clean package: https://github.com/spmason/dmp-buildx-bug

Note that commenting out the <buildx> or <dockerFile> config gets past the error. The same config also works for single-module projects

Info

  • docker-maven-plugin version : 0.40.0
  • Maven version (mvn -v) :
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /usr/local/Cellar/maven/3.8.4/libexec
Java version: 11.0.12, vendor: Homebrew, runtime: /usr/local/Cellar/openjdk@11/11.0.12/libexec/openjdk.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "12.3.1", arch: "x86_64", family: "mac"
  • Docker version : Docker Desktop 4.8.2 (MacOS 12.3.1) (it also fails on our Linux build nodes so it's not mac-specific)
  • If it's a bug, how to reproduce : Download the repo and run mvn clean package
  • If it's a feature request, what is your use case : N/A
  • Sample project : https://github.com/spmason/dmp-buildx-bug.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants