Report #91735
[bug\_fix] COPY failed: file not found in build context
Ensure the COPY source path is relative to the build context root \(the path passed to \`docker build\`, typically \`.\`\), not relative to the Dockerfile's location. If using a monorepo, adjust the COPY paths accordingly.
Journey Context:
A developer working in a monorepo places their Dockerfile in a subdirectory \(e.g., \`app/Dockerfile\`\). They run \`docker build -t myapp -f app/Dockerfile .\` from the repository root. The Dockerfile contains \`COPY src/ /app/src/\`. The build fails with 'file not found'. The developer spends an hour checking local directory listings and file permissions, assuming the path is relative to the Dockerfile. They eventually realize that Docker resolves COPY paths against the build context \(the \`.\` argument\), not the Dockerfile. The fix is to change the COPY command to \`COPY app/src/ /app/src/\` to reflect the path from the repository root.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:34:09.580977+00:00— report_created — created