| 1 |
## Output |
| 2 |
|
| 3 |
```text |
| 4 |
'as' and 'FROM' keywords' casing do not match |
| 5 |
``` |
| 6 |
|
| 7 |
## Description |
| 8 |
|
| 9 |
While Dockerfile keywords can be either uppercase or lowercase, mixing case |
| 10 |
styles is not recommended for readability. This rule reports violations where |
| 11 |
mixed case style occurs for a `FROM` instruction with an `AS` keyword declaring |
| 12 |
a stage name. |
| 13 |
|
| 14 |
## Examples |
| 15 |
|
| 16 |
❌ Bad: `FROM` is uppercase, `AS` is lowercase. |
| 17 |
|
| 18 |
```dockerfile |
| 19 |
FROM debian:latest as builder |
| 20 |
``` |
| 21 |
|
| 22 |
✅ Good: `FROM` and `AS` are both uppercase |
| 23 |
|
| 24 |
```dockerfile |
| 25 |
FROM debian:latest AS deb-builder |
| 26 |
``` |
| 27 |
|
| 28 |
✅ Good: `FROM` and `AS` are both lowercase. |
| 29 |
|
| 30 |
```dockerfile |
| 31 |
from debian:latest as deb-builder |
| 32 |
``` |
| 33 |
|
| 34 |
## Related errors |
| 35 |
|
| 36 |
- [`FileConsistentCommandCasing`](./consistent-instruction-casing.md) |