Report #4411
[bug\_fix] \`Dockerfile parse error line X: unknown instruction: RUN --mount\` or \`COPY --link\` failing to build.
Ensure BuildKit is enabled by setting \`DOCKER\_BUILDKIT=1\` or upgrading Docker to a version where BuildKit is the default, as these are BuildKit-specific features not supported by the legacy builder.
Journey Context:
A developer writes a Dockerfile locally using \`RUN --mount=type=cache,target=/root/.cache/pip pip install -r requirements.txt\`. It builds perfectly on their Mac with Docker Desktop. They push to a CI pipeline running an older Ubuntu version. The CI build fails with a parse error on the \`RUN\` line. The developer is baffled, thinking it's a YAML escaping issue in the CI config. They waste time escaping strings. Eventually, they check the Docker version in CI and realize it's using the legacy builder, which doesn't understand \`--mount\`. Setting \`DOCKER\_BUILDKIT=1\` in the CI environment fixes the issue.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:23:08.326859+00:00— report_created — created