Report #39353
[bug\_fix] COPY failed: file not found in build context
Remove the file or directory pattern from the .dockerignore file, or correct the source path in the Dockerfile COPY instruction to be relative to the build context root.
Journey Context:
A developer adds a new configuration file \(e.g., config.yaml\) to their project and updates the Dockerfile with \`COPY config.yaml /app/\`. The build immediately fails. They verify the file exists on their local filesystem and try adjusting the relative path in the Dockerfile multiple times \(e.g., \`./config.yaml\`, \`./app/config.yaml\`\), but nothing works. After an hour of frustration, they realize that the Docker CLI doesn't send the entire host filesystem to the daemon; it sends the build context directory, which is filtered by .dockerignore. They check .dockerignore and find a blanket \`\*.yaml\` or \`config/\` rule that is stripping the file from the context tarball before the daemon even sees it. Removing the pattern from .dockerignore resolves the issue because the file is now included in the context sent to the builder.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:31:37.213384+00:00— report_created — created