Open groogiam opened 8 months ago
This seems to be related to builds done through docker compose using the Visual Studio tooling. I created an issue in that repository as well and referenced this issue.
The issue also affects command line builds where build context is not in the same directory as the Dockerfile
$ docker compose build
failed to solve: changes out of order: "shared/hello.txt" ""
$ docker build . -f foo/Dockerfile
[ Succeeds ]
Here's the SSCCE as a unified diff:
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..5c23147
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,5 @@
+services:
+ foo:
+ build:
+ context: .
+ dockerfile: foo/Dockerfile
diff --git a/foo/Dockerfile b/foo/Dockerfile
new file mode 100644
index 0000000..917a55a
--- /dev/null
+++ b/foo/Dockerfile
@@ -0,0 +1,3 @@
+FROM alpine:3.14
+COPY shared/hello.txt /app
+ENTRYPOINT ["sleep", "infinity"]
diff --git a/shared/hello.txt b/shared/hello.txt
new file mode 100644
index 0000000..557db03
--- /dev/null
+++ b/shared/hello.txt
@@ -0,0 +1 @@
+Hello World
Same problem/error for me after upgrading to version 4.27.1.
In my case the Dockerfile even is in the same directory but under a different name.
$ docker compose build
failed to solve: failed to compute cache key: failed to calculate checksum of ref <ref>: failed to walk /var/lib/docker/tmp/<buildkit>/<dir>: lstat /var/lib/docker/tmp/<buildkit>/<dir>: no such file or directory
$ docker build . -f foo.Dockerfile
[ Succeeds ]
Well, I just updated to the newly released version 4.27.2 and at least for me everything works normally again.
Description
After upgrading to Docker 4.27 my project no longer builds. Docker cannot seem to find files that are on the disk.
https://github.com/docker/buildx/pull/10 ERROR: failed to calculate checksum of ref 7e5e69fe-0a93-4e6f-94a2-6d69155a6ff7::ry4vsmtlgm8vymwaaeuecfhcn: failed to walk /var/lib/docker/tmp/buildkit-mount1368382612/MyProject/docker-build: lstat /var/lib/docker/tmp/buildkit-mount1368382612/MyProject/docker-build: no such file or directory
Reproduce
Docker build my project.
Expected behavior
Build should succeed as it did in 4.26.1.
docker version
docker info
Diagnostics ID
818ADD6C-31C5-4F14-AE3A-C97FCC082F74/20240128172229
Additional Info
I have opened a similar issue here https://github.com/docker/buildx/issues/2218