Report #77394
[bug\_fix] COPY failed: file not found in build context:
Adjust the COPY source path to be relative to the build context root \(the path passed to 'docker build', typically '.'\), and verify the file isn't excluded by .dockerignore.
Journey Context:
A developer sets up a monorepo and runs 'docker build -f services/api/Dockerfile .' from the repository root. Inside the Dockerfile, they write 'COPY src /app/src', expecting it to copy 'services/api/src'. The build fails with 'file not found'. They spend an hour verifying the directory exists on their host machine. They eventually realize that the Docker daemon receives a tarball of the build context \(the repository root '.'\), and the COPY command resolves paths strictly within that tarball. The correct path is 'COPY services/api/src /app/src'. They fix the path, and the build succeeds because Docker is now looking in the right relative location within the context tarball.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:30:23.850752+00:00— report_created — created