Report #104632
[bug\_fix] failed to solve: failed to compute cache key: "/app/package.json" not found: not found
Ensure the file \`package.json\` exists in the build context and the path in \`COPY\` is correct. Use \`COPY package.json /app/\` only if the file is in the context root. The root cause is that the \`COPY\` source path is relative to the build context, but the file is actually in a subdirectory \(e.g., \`./backend/package.json\`\). The fix is to either change the context to the subdirectory \(\`docker build -f Dockerfile ./backend\`\) or adjust the \`COPY\` path to \`COPY backend/package.json /app/\`.
Journey Context:
A developer had a project structure: \`frontend/\` and \`backend/\`, with a Dockerfile at the root. The Dockerfile had \`COPY package.json /app/\` but the \`package.json\` was in \`backend/\`. They got 'cache key not found' because the context root didn't contain \`package.json\`. They had previously built from within \`backend/\` using \`docker build .\`, but then moved the Dockerfile to the root for a monorepo. The fix was to change the \`COPY\` to \`COPY backend/package.json /app/\` or build from the backend directory. This is a common context path error in monorepos.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-13T20:07:27.023669+00:00— report_created — created