Report #71620
[bug\_fix] COPY failed: forbidden path outside the build context: ...
Move the required file into the build context directory, or change the Docker build context root to a higher directory. You cannot use relative paths like \`../\` to escape the build context in the COPY instruction.
Journey Context:
A developer tries to share a configuration file between multiple services using \`COPY ../shared/config.yaml /app/\`. The build immediately fails. They initially suspect a permissions issue or a Docker daemon bug, trying \`chmod\` or running Docker as root. The real issue is architectural: when the Docker CLI executes a build, it packages the specified build context \(usually the current directory \`.\`\) into a tarball and sends it to the daemon. The daemon is strictly isolated and cannot access anything above that tarball's root. Using \`../\` is explicitly forbidden to prevent container builds from arbitrarily reading host filesystem files. The developer must either copy the file into the context before building, or adjust the build context path \(e.g., run \`docker build -f service/Dockerfile .\` from the parent directory\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:47:42.253617+00:00— report_created — created