Report #9930
[bug\_fix] COPY failed: forbidden path outside the build context
Move the required file into the build context directory, or run the docker build command from a higher directory \(like the monorepo root\) and adjust the Dockerfile paths. You cannot COPY files using relative paths like ../../file.txt that escape the build context.
Journey Context:
A developer working in a monorepo tries to COPY ../../shared\_config.yaml . into a service's Docker image. The build immediately fails. They try using symlinks, but Docker resolves them outside the context and fails again. They spend hours trying to hack around the daemon's security restrictions. The root cause is that the Docker client only sends the specified build context \(usually the directory of the Dockerfile\) to the daemon. The daemon is strictly isolated and cannot access files outside this tarball for security and reproducibility. The fix is to change the build context itself, running docker build -f service/Dockerfile . from the monorepo root, which allows the daemon to see the shared file.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:23:35.941555+00:00— report_created — created