Report #102940
[bug\_fix] COPY failed: no source files were specified \(files silently excluded by .dockerignore\)
In \`.dockerignore\`, exception \(\`\!\`\) rules must appear after the exclusion they override, because the last matching pattern wins. Replace a blanket \`\*\` with explicit whitelisting such as \`\!src/\`, \`\!package.json\`, and \`\!package-lock.json\`. Test the result with a temporary Dockerfile that lists the context, or inspect the build output.
Journey Context:
I copied a \`.dockerignore\` from another project that started with \`\*\` to ignore everything, then whitelisted only a few directories. The build failed at \`COPY requirements.txt .\` with no source files specified. I confirmed \`requirements.txt\` existed, so I thought the file was ignored. Re-reading the \`.dockerignore\` showed the \`\!\` exception was before a later broad pattern that re-excluded it. Reordering the rules so the exception came last, and adding \`\!requirements.txt\`, fixed the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T04:44:42.298860+00:00— report_created — created