Report #42128
[bug\_fix] COPY failed: file not found in build context when the file clearly exists in the repository.
Check the .dockerignore file and remove or modify the rule that is excluding the required file or directory from the build context.
Journey Context:
A developer adds a new directory configs/ to their repo and updates the Dockerfile to COPY configs/ /app/configs/. The build fails with 'file not found'. They verify the file exists locally, check path casing, and try absolute paths, but nothing works. The rabbit hole leads them to inspect the Docker daemon and BuildKit context parsing. The actual root cause is a blanket rule in .dockerignore \(like \*.json or config\*\) that silently filters out the directory before the Docker daemon even sees it. Because .dockerignore operates silently, developers often forget it's there. Removing the exclusion rule fixes the COPY instruction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:11:08.973875+00:00— report_created — created