Report #79246
[bug\_fix] COPY failed: file not found in build context or forbidden path outside the build context
Move the file into the build context directory, adjust the Dockerfile COPY path to be relative to the context root, or remove the file/pattern from the .dockerignore file.
Journey Context:
A developer attempts to COPY a configuration file from a parent directory using something like COPY ../config.yml /app/. The build immediately fails. They spend time verifying the file exists on their local disk and has the right permissions, confused as to why Docker cannot see it. The rabbit hole deepens when they try absolute paths, which also fail. The root cause is that the Docker CLI sends a 'context' \(usually the current directory, .\) as a tarball to the Docker daemon. The daemon cannot access anything outside this tarball, meaning parent directories \(..\) and absolute paths are strictly forbidden. Alternatively, the file is inside the context but matches a rule in .dockerignore, silently excluding it from the tarball.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:36:20.033693+00:00— report_created — created