Report #3868
[bug\_fix] COPY failed: forbidden path outside the build context
Run docker build from the repository root and specify the Dockerfile using the -f flag, adjusting COPY paths to be relative to the root.
Journey Context:
Developer has a monorepo with a Dockerfile in ./services/api/Dockerfile. They run docker build ./services/api/ and try to COPY ../../shared/utils /app/utils. The build fails. They try changing the path, using absolute paths, etc., hitting a rabbit hole of path manipulation. The root cause is that the Docker CLI zips up the context directory \(./services/api/\) and sends it to the daemon. The daemon cannot access anything outside that tarball. The fix works because running docker build from the repo root with -f changes the build context to include the entire repository, allowing the daemon to access shared/utils.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:21:06.125098+00:00— report_created — created