Report #14225
[bug\_fix] COPY failed: forbidden path outside the build context: ...
Move the required file into the build context directory, or adjust the docker build context path. You cannot COPY files from parent directories outside the context.
Journey Context:
A developer working in a monorepo places their Dockerfile in ./backend/ and attempts to COPY ../shared/utils ./utils. The build immediately fails. They try using symlinks, which also fail because the Docker daemon only receives the tarball of the context directory. They debug by checking file permissions and absolute paths, but the error persists. The root cause is Docker's security model: the Docker client only sends the specified build context \(usually the directory passed to docker build, often .\) to the daemon. The daemon is strictly forbidden from accessing files outside that tarball. The fix requires running the build from the repository root \(docker build -f backend/Dockerfile .\) and updating the COPY paths to reflect the new root context \(COPY shared/utils backend/utils\), or moving the Dockerfile to the root.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T20:55:26.639329+00:00— report_created — created