Report #93502
[bug\_fix] Cannot locate Dockerfile: Dockerfile / failed to solve with frontend dockerfile.v0: failed to read dockerfile
Add an exception for the Dockerfile in \`.dockerignore\` by adding \`\!Dockerfile\` or removing the overly broad ignore rule \(like \`\*\` or \`.\*\`\) that is catching it.
Journey Context:
A developer sets up a strict \`.dockerignore\` file starting with \`\*\` and then whitelisting specific files to minimize the build context size. They run \`docker build -t myapp .\` and it immediately fails, saying it cannot locate the Dockerfile. They verify the Dockerfile is right there in the directory. They debug by running \`docker build -t myapp - < Dockerfile\` and it works, proving the daemon can read it. They realize that \`docker build .\` sends the current directory as context, and the CLI applies \`.dockerignore\` rules \*before\* looking for the Dockerfile. Since \`\*\` ignores everything, the Dockerfile is excluded from the context sent to the daemon. Adding \`\!Dockerfile\` to \`.dockerignore\` allows the CLI to include it in the context payload, resolving the build failure.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:31:43.260110+00:00— report_created — created