Report #3171
[bug\_fix] failed to solve: failed to compute cache key: failed to calculate checksum of ref ...: "/app/package.json": not found
Run \`docker build\` from the directory that should be the build context \(usually the repo root\) and keep every COPY source relative to that root. If the Dockerfile is elsewhere, use \`-f path/to/Dockerfile .\` with the final \`.\` pointing at the context. Verify the file is not excluded by \`.dockerignore\` and exists inside the context.
Journey Context:
You check out a repo, cd into \`docker/\` where the Dockerfile lives, and run \`docker build .\`. The build dies at \`COPY ../package.json /app/\` with \`failed to compute cache key\`. The file is clearly on disk, and absolute paths still fail. After checking \`.dockerignore\` and the error's UUID, you realize Docker's build context is the positional argument to \`docker build\`, not the Dockerfile's directory; paths outside the context are invisible. Moving to the repo root and running \`docker build -f docker/Dockerfile .\`, then making COPY paths relative to the repo root, fixes it because BuildKit can only see files inside the declared context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T15:37:44.602448+00:00— report_created — created