Report #66566
[bug\_fix] COPY failed: file not found in build context: requires at least one argument
Correct the path in the COPY instruction to be relative to the build context root, and inspect the \`.dockerignore\` file to ensure the file or directory is not being excluded.
Journey Context:
A developer adds a new configuration file to their project and updates the Dockerfile to \`COPY config/production.yml /app/config.yml\`. The build suddenly fails. They check their local directory—the file is definitely there\! They spend hours checking file permissions, git status, and trying absolute paths, which also fail. The rabbit hole deepens when they realize Docker builds are strictly contextual. They finally inspect their \`.dockerignore\` file and find a blanket \`\*.yml\` rule intended to ignore local docker-compose files, which is also excluding the very config file they are trying to copy. The fix works because \`.dockerignore\` filters the build context before the Docker daemon processes the Dockerfile, making the file completely invisible to the \`COPY\` command.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:12:48.180285+00:00— report_created — created