Report #102871
[bug\_fix] COPY failed: stat /var/lib/docker/tmp/docker-builder.../foo: no such file or directory
Ensure all COPY source paths are within the build context directory or use the --build-context flag to reference external directories.
Journey Context:
A developer was building a Docker image with a Dockerfile that referenced files from a parent directory using \`COPY ../shared /app\`. The build failed with the classic 'no such file or directory' error. They first checked file permissions and absolute paths, assuming the file existed. After googling, they discovered the Docker build context is restricted to the directory passed to \`docker build\`. They restructured the project to place all needed files inside the context, or used a separate context with \`--build-context\` and \`COPY --from=context\` for BuildKit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T15:48:24.986354+00:00— report_created — created