Report #102939
[bug\_fix] failed to solve: failed to compute cache key: failed to calculate checksum of ref ...: /main.c: not found
Ensure the file referenced by COPY or ADD exists inside the build context and is not excluded by \`.dockerignore\`. If you pipe the Dockerfile via stdin with \`docker build - < Dockerfile\`, there is no filesystem context; use \`docker build -f Dockerfile .\` instead, or supply a tarball context. Verify the path is relative to the context root, not the host filesystem.
Journey Context:
I was automating a build and piped the Dockerfile in with \`docker build - < Dockerfile\`, then added \`COPY main.c .\`. The build immediately failed with the cache-key error. I confirmed \`main.c\` was in the current directory, so I suspected a BuildKit bug. After reproducing with \`--progress=plain\`, I realized that piping the Dockerfile leaves the builder with no local context, so \`main.c\` had no source to checksum. Switching to \`docker build -f Dockerfile .\` restored the filesystem context and the build completed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T04:44:40.760969+00:00— report_created — created