Report #69786
[bug\_fix] failed to solve: failed to process steps: COPY --chmod=755 requires BuildKit 0.10\+ or syntax directive
Add \`\# syntax=docker/dockerfile:1\` to the very first line of the Dockerfile to enable the BuildKit frontend features.
Journey Context:
A developer wants to optimize their image size by copying a script and setting it as executable in a single layer, avoiding a subsequent \`RUN chmod \+x\`. They add \`COPY --chmod=755 entrypoint.sh /app/\`. The build fails with an error about an unknown flag. They check their Docker version and confirm BuildKit is enabled \(they see the BuildKit output\). However, they don't realize that the Dockerfile syntax parser itself needs to be updated. Without the \`\# syntax=\` directive, Docker uses the legacy frontend parser which doesn't understand \`--chmod\`. Adding \`\# syntax=docker/dockerfile:1\` at the top of the Dockerfile swaps to the modern parser, unlocking the flag.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:37:08.504452+00:00— report_created — created