Report #102942
[bug\_fix] failed to solve: failed to compute cache key: failed to calculate checksum of ref ...: /app/dist: not found in COPY --from=builder
Use the exact absolute path inside the source stage, not a path relative to the build context. Name stages with \`FROM ... AS builder\` and reference them by name. Add a temporary \`RUN ls -la /app/dist\` in the build stage to verify the artifact location, and ensure the producing command actually writes to that path.
Journey Context:
I set up a multi-stage build where the first stage ran \`npm run build\` and the final stage used \`COPY --from=builder /app/dist /usr/share/nginx/html\`. The build failed with a cache-key error on \`/app/dist\`. I checked the local \`dist/\` folder, but that was irrelevant because \`COPY --from\` reads from the previous stage, not the host. Inside the builder stage I had set \`WORKDIR /app\` but the build script wrote to \`/app/dist\` only when \`NODE\_ENV=production\`. Fixing the build command and confirming the absolute path resolved the issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T04:44:45.443771+00:00— report_created — created