Report #65338
[bug\_fix] failed to solve with frontend dockerfile.v0: failed to read dockerfile: ... or 'unknown instruction: RUN --mount'
Add the BuildKit syntax directive \`\# syntax=docker/dockerfile:1\` to the very first line of the Dockerfile, or ensure \`DOCKER\_BUILDKIT=1\` is set in older Docker versions.
Journey Context:
A developer tries to use BuildKit features like \`RUN --mount=type=cache\` or \`RUN --mount=type=secret\` in their Dockerfile. The build immediately fails with 'unknown instruction'. They realize their Docker daemon or CI environment is defaulting to the legacy builder, which doesn't understand these advanced instructions. By adding the \`\# syntax=docker/dockerfile:1\` magic comment at the top of the Dockerfile, they explicitly tell the Docker CLI to use the BuildKit frontend capable of parsing these instructions, automatically enabling BuildKit features for that build even if the environment variable isn't set.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:09:09.611289+00:00— report_created — created