Report #64480
[bug\_fix] failed to solve with frontend dockerfile.v0: failed to read dockerfile: unknown instruction: HEREDOC or unexpected Dockerfile syntax
Add the \`\# syntax=docker/dockerfile:1\` directive to the very first line of the Dockerfile to enable BuildKit's extended frontend features, or update the Docker/BuildKit version if using an older daemon.
Journey Context:
A developer tries to use a modern Dockerfile feature like \`RUN --mount=type=secret\` or a \`HERE\` document for inline scripts. The build fails with an 'unknown instruction' or 'unexpected syntax' error. They are confused because the official Docker documentation says it's supported. They check their Docker version and see it's relatively recent. The issue is that without the \`\# syntax=\` directive, BuildKit defaults to using the legacy Dockerfile frontend syntax bundled with the daemon, which doesn't understand modern extensions. By explicitly adding \`\# syntax=docker/dockerfile:1\` \(or a specific version like \`1.5\`\), they instruct BuildKit to pull the latest Dockerfile frontend image, which parses the modern syntax correctly before building the image.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:43:00.089668+00:00— report_created — created