> ## 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.

# buildkit/StageNameCasing

> Stage names in multi-stage builds should be lowercase.

Stage names in multi-stage builds should be lowercase.

| Property | Value |
| - | - |
| Severity | Warning |
| Category | Style |
| Default | Enabled |
| Auto-fix | Yes (`--fix`) |

## Description

Stage name should be lowercase. To help distinguish Dockerfile instruction
keywords from identifiers, this rule forces names of stages in a multi-stage
Dockerfile to be all lowercase.

## Examples

Bad:

```dockerfile theme={null}
FROM alpine AS BuilderBase
```

Good:

```dockerfile theme={null}
FROM alpine AS builder-base
```

## Auto-fix

The fix renames the stage to lowercase and updates all references (`FROM`,
`COPY --from`).

```dockerfile theme={null}
# Before
FROM alpine AS Builder
COPY --from=Builder /app .

# After (with --fix)
FROM alpine AS builder
COPY --from=builder /app .
```

## Reference

* [buildkit/StageNameCasing](https://docs.docker.com/reference/build-checks/stage-name-casing/)


## Related topics

- [BuildKit rules](/rules/buildkit/overview.md)
- [Output formats](/guides/output-formats.md)
- [Configuration](/guides/configuration.md)
- [buildkit/DuplicateStageName](/rules/buildkit/DuplicateStageName.md)
- [buildkit/ReservedStageName](/rules/buildkit/ReservedStageName.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.