Report #21026
[bug\_fix] COPY failed: file not found in build context
Move the Dockerfile to the build context root or adjust the docker build command to point to the correct context directory \(e.g., docker build -f services/api/Dockerfile .\). Docker cannot access files outside the designated build context sent to the daemon.
Journey Context:
A developer in a monorepo places a Dockerfile in services/api/Dockerfile and runs docker build . from that directory. They attempt to COPY ../../shared/utils /app/shared. The build fails. They try absolute paths, thinking it's a symlink or permission issue, but it continues to fail. They eventually realize the Docker client sends the entire build context \(the current directory, .\) to the daemon, and the daemon is sandboxed—it cannot traverse above the context root. The fix is to run the build from the monorepo root, specifying the Dockerfile path, so the context includes the shared folder.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:41:42.076064+00:00— report_created — created