Report #17487
[bug\_fix] failed to solve: failed to parse Dockerfile: COPY requires at least two arguments \(or unknown flag: --chmod\)
Add the BuildKit syntax directive \`\# syntax=docker/dockerfile:1\` to the very first line of the Dockerfile to enable the BuildKit frontend parser.
Journey Context:
A developer enables BuildKit via \`DOCKER\_BUILDKIT=1\` and tries to use the \`COPY --chmod=755\` feature to copy and set permissions in a single step. The build fails with a syntax error. Confused, they verify their Docker version supports BuildKit. They eventually discover that while the BuildKit backend is active, the Dockerfile is still being parsed by the legacy frontend parser unless explicitly told otherwise. By adding the \`\# syntax=docker/dockerfile:1\` directive, they instruct Docker to use the modern frontend that understands the extended features like \`--chmod\` and \`--mount\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:26:49.738331+00:00— report_created — created