Dockerfile parse error line N: unknown instruction
A line in the Dockerfile doesn’t start with a valid instruction — usually a broken line continuation or a typo.
Seen on:
Docker
Meaning
Every non-comment line must start with an instruction (FROM, RUN, COPY…). If a multi-line RUN is missing a trailing backslash, or has a space after it, the next line is read as a new instruction like “apt-get” or “&&”.
Common causes
- Missing \ at the end of a continued line
- Space or CRLF after the backslash
- Typo in an instruction (COPPY, ENTRYPIONT)
- Shell commands pasted without RUN
⚡ Quick fix
- Check the line number and the line before it
- Make sure each continued line ends with \ and nothing after it
- Convert the file to LF line endings
Detailed fix by platform
Dockerfile
- bash
RUN apt-get update \\ && apt-get install -y curl
How to diagnose
- Line — The reported line and the one above
- Endings — file Dockerfile (CRLF?)
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Docker
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026