Report #90624
[bug\_fix] Dockerfile parse error: unknown instruction: RUN --mount=type=secret
Enable BuildKit by setting DOCKER\_BUILDKIT=1 or by using docker buildx build instead of the legacy docker build command.
Journey Context:
A developer tries to securely pass a GitHub PAT to a Dockerfile using the relatively new RUN --mount=type=secret syntax to clone a private repository. The build instantly fails with a parse error. They double-check the syntax against documentation, convinced they have a typo. They spend time rewriting the instruction, only to get the same error. The rabbit hole ends when they realize their CI environment or local Docker daemon defaults to the legacy builder, which does not understand the BuildKit-specific --mount flag. Setting DOCKER\_BUILDKIT=1 resolves it because it switches the engine to BuildKit, which implements the extended Dockerfile frontend required for secret mounts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:42:23.462329+00:00— report_created — created