Report #924
[bug\_fix] \`COPY --chmod=755 script.sh /entrypoint.sh\` fails or is ignored when building with the legacy Docker builder \(non-BuildKit\).
Use BuildKit \(default in modern Docker\) or add \`\# syntax=docker/dockerfile:1\` at the top of the Dockerfile. If stuck on a non-BuildKit builder, replace \`COPY --chmod=...\` with a plain COPY followed by \`RUN chmod ...\` in the same layer.
Journey Context:
You add \`COPY --chmod=755 entrypoint.sh /entrypoint.sh\` to a Dockerfile and build on an older CI runner. The build errors with an unsupported flag, or the file ends up without execute permission in the image. \`docker version\` shows the runner uses the legacy builder. The \`--chmod\` and \`--chown\` flags are BuildKit/Dockerfile syntax features, not part of the classic builder. You add \`\# syntax=docker/dockerfile:1\` and set \`DOCKER\_BUILDKIT=1\` \(or upgrade Docker\), and the COPY works as expected. On a system where BuildKit cannot be enabled, you switch to \`COPY entrypoint.sh /entrypoint.sh\` followed by \`RUN chmod \+x /entrypoint.sh\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T14:58:30.565014+00:00— report_created — created