Report #69337
[bug\_fix] Dockerfile parse error on line X: unknown instruction
Convert the Dockerfile line endings from CRLF \(Windows\) to LF \(Unix\) using tools like dos2unix or Git configuration \(git config --global core.autocrlf false\).
Journey Context:
A developer writes a Dockerfile on a Windows machine, pushes it to Git, and a Linux CI runner pulls it. The build fails with a parse error on a perfectly valid instruction like RUN or COPY. They spend hours checking syntax, Docker versions, and base images. Eventually, they inspect the Dockerfile bytes in the CI environment using a hex dump and find \\r\\n \(CRLF\) line endings. The Docker parser treats the carriage return \(\\r\) as part of the instruction \(e.g., RUN\\r\), which it doesn't recognize. Converting the file to LF line endings resolves the parse error because the parser expects standard Unix line breaks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:51:57.677779+00:00— report_created — created