> ## Documentation Index
> Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# tally/require-stages

> Dockerfile has no stages to build.

Dockerfile has no stages to build.

| Property | Value                                |
| -------- | ------------------------------------ |
| Severity | Error                                |
| Category | Correctness                          |
| Default  | Enabled                              |
| Type     | Fail-fast syntax check (exit code 4) |

## Description

Every Dockerfile must contain at least one `FROM` instruction to define a build stage.
A file with only `ARG`, `RUN`, `COPY`, or other instructions but no `FROM` always fails
at build time with:

```text theme={null}
ERROR: dockerfile contains no stages to build
```

This check catches the problem before any other linting runs, aborting with exit code 4
(syntax error). Common causes:

* A `FROM` line was accidentally deleted during a refactor
* An AI-generated patch removed or failed to include a `FROM` instruction
* A Dockerfile fragment was saved as a standalone file

## Examples

### Bad

```dockerfile theme={null}
# Missing FROM — no build stages defined
ARG VERSION=1.0
RUN apk add --no-cache curl
COPY . /app
```

### Good

```dockerfile theme={null}
ARG VERSION=1.0
FROM alpine:3.20
RUN apk add --no-cache curl
COPY . /app
```

## Related Rules

* [`hadolint/DL3061`](../hadolint/DL3061) detects non-`ARG` instructions that appear
  *before* the first `FROM`. When no `FROM` exists at all, `tally/require-stages` fires
  first and DL3061 is not reached.
