Report #91441
[bug\_fix] failed to solve: unknown flag: mount
Enable BuildKit by setting the \`DOCKER\_BUILDKIT=1\` environment variable or by using \`docker buildx build\` instead of the legacy \`docker build\` command.
Journey Context:
A developer adds \`RUN --mount=type=cache,target=/root/.cache/pip ...\` to their Dockerfile to speed up dependency installation in CI. The build immediately fails with a syntax error regarding the \`--mount\` flag. They check the Dockerfile syntax repeatedly, certain it matches the documentation. After a deep dive into GitHub issues, they discover their CI environment defaults to the legacy Docker builder, which does not support BuildKit-specific syntax. By exporting \`DOCKER\_BUILDKIT=1\`, the fix works because it routes the build through the BuildKit backend, which implements the \`--mount\` flag for RUN instructions, whereas the legacy builder parses it as an invalid argument.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:04:36.820063+00:00— report_created — created