Report #75490
[bug\_fix] failed to solve: frontend dockerfile.v0: failed to read dockerfile or /bin/sh: 1: ^M: not found
Convert the Dockerfile line endings from CRLF \(Windows\) to LF \(Unix\) using an editor setting, dos2unix, or by configuring Git with git config --global core.autocrlf false.
Journey Context:
A developer working on a Windows machine creates a Dockerfile. It builds fine locally using Docker Desktop, but fails in their Linux-based CI pipeline with a bizarre syntax error or a 'command not found' error that includes a hidden carriage return character \(^M\). They spend hours comparing their Dockerfile character-by-character to a working example, seeing no difference. The root cause is Windows CRLF line endings. Docker builds run in a Linux environment where the shell interprets the carriage return \(\\r\) as an actual character appended to the command. Git often preserves CRLF on Windows checkouts. Converting the file to LF ensures the Linux shell can parse the instructions correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:18:34.145297+00:00— report_created — created