Report #102876
[bug\_fix] COPY failed: stat /var/lib/docker/tmp/docker-builder.../src: no such file or directory \(due to .dockerignore\)
Review the \`.dockerignore\` file to ensure it does not accidentally exclude files or directories needed by COPY instructions. Use \`docker build --no-cache\` and check the build context list with \`tar -tf\` to debug.
Journey Context:
A developer added a \`.dockerignore\` to speed up builds by excluding node\_modules. However, they inadvertently included a pattern like \`src\` that also matched the source code directory they intended to COPY. The build failed with 'no such file or directory' for \`COPY src/ /app\`. They assumed a path issue and tried absolute paths and symlinks, all failing. After running \`docker build --no-cache -f Dockerfile .\` and examining the build context with \`tar -czf - . \| tar -tzf -\`, they saw \`src\` was missing. Removing the offending pattern from \`.dockerignore\` fixed the build.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T15:49:03.358024+00:00— report_created — created