buildkit/ConsistentInstructionCasing¶
Instruction keywords should use consistent casing throughout the Dockerfile.
| Property | Value |
|---|---|
| Severity | Warning |
| Category | Style |
| Default | Enabled |
| Auto-fix | Yes (--fix) |
Description¶
Instruction keywords should use consistent casing (all lowercase or all uppercase). Using a case that mixes uppercase and lowercase, such as PascalCase or snakeCase, results in poor readability.
Examples¶
Bad:
Good (all uppercase):
Good (all lowercase):
Auto-fix¶
The fix changes instruction keywords to match the majority casing in the Dockerfile.
# Before (majority is uppercase)
FROM alpine
run echo hello
# After (with --fix)
FROM alpine
RUN echo hello