Report #103766
[bug\_fix] ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref ...: "/app/public": not found when copying from a previous stage in a multi-stage build.
Verify that the source path exists in the upstream stage and is absolute \(paths in COPY --from are resolved from the root of that stage, not its WORKDIR\). Make sure the upstream stage actually ran and produced the artifact; if you are building with --target, earlier stages may be skipped. Use a concrete absolute path such as 'COPY --from=builder /app/public ./public'.
Journey Context:
A Next.js Dockerfile builds dependencies in a 'builder' stage and then copies 'COPY --from=builder /app/public ./public'. In CI the build fails saying /app/public is not found, even though it works locally. The developer realizes the CI step used '--target runner', which skips the 'builder' stage entirely, and also that the local build had stale layers from a previous successful run. After removing --target or reordering stages, and confirming /app/public is created by 'next build', the COPY succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:40:20.875680+00:00— report_created — created