Report #67846
[bug\_fix] failed to process ... unexpected keyword "mount"
Add \# syntax=docker/dockerfile:1 to the very first line of the Dockerfile to enable BuildKit frontends, and ensure DOCKER\_BUILDKIT=1 is set for older Docker versions.
Journey Context:
A developer adds RUN --mount=type=cache,target=/root/.cache/pip ... to speed up their CI pipeline. The build fails with a syntax error on the mount keyword. They assume the syntax is wrong and try variations, but the real issue is that the legacy Docker builder doesn't support --mount. BuildKit requires the magic syntax comment to load the external Dockerfile frontend that interprets these extensions. Adding the directive tells BuildKit to use the modern parser, unlocking cache mounts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:21:26.673984+00:00— report_created — created