Report #99130
[bug\_fix] failed to compute cache key: failed to walk ...: lstat ...: no such file or directory
Use absolute source paths in \`COPY --from=\` and confirm the artifact exists at that exact path in the source stage. Relative paths in \`COPY --from\` are resolved from the root of the source stage's filesystem, not from its WORKDIR, so omitting the leading slash is usually the mistake.
Journey Context:
A team is converting a Spring Boot build to multi-stage. The first stage extracts layers to \`dependencies/\`, \`snapshot-dependencies/\`, \`spring-boot-loader/\`, and \`application/\`. In the final stage they write \`COPY --from=build-stage dependencies/ /tmp\`. The build fails with \`failed to compute cache key: failed to walk .../dependencies: no such file or directory\`. They add \`RUN ls -lR\` to the build stage and see the directories are there. They then learn that \`COPY --from\` source paths are absolute by default: the working directory of the build stage does not carry over. Changing the instruction to \`COPY --from=build-stage /dependencies/ /tmp\` fixes it, because the files were extracted to the stage root, not to the WORKDIR.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:36:58.170351+00:00— report_created — created