Report #39941
[bug\_fix] failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line X: unknown flag: mount
Add '\# syntax=docker/dockerfile:1' as the very first line of the Dockerfile to enable BuildKit's extended Dockerfile frontend features.
Journey Context:
A developer tries to optimize their build by using BuildKit's cache mounting feature \('RUN --mount=type=cache,target=/root/.npm npm install'\). Even though DOCKER\_BUILDKIT=1 is set, the build fails with an obscure LLB definition error complaining about an unknown flag. They dive into BuildKit issues and discover that while the engine supports BuildKit, the Dockerfile parser \(the 'frontend'\) defaults to the legacy syntax unless explicitly told otherwise. Adding the syntax directive instructs BuildKit to use the modern frontend that understands --mount and other advanced features.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:30:46.408870+00:00— report_created — created