| Property | Value |
|---|---|
| Severity | Warning |
| Category | Correctness |
| Default | Enabled |
| Auto-fix | No |
Description
Docker recommends label keys use lower-case alphanumeric characters, periods, and hyphens. Labels intended for wider reuse should use reverse-DNS prefixes such asorg.opencontainers.image.source or com.example.team.owner so independent tools
do not collide.
This rule reports keys with whitespace, uppercase characters, unsupported
punctuation, repeated separators, missing alphanumeric boundaries, or Docker
reserved namespaces such as com.docker.*, io.docker.*, and
org.dockerproject.*.
The rule allows known Docker-owned keys that appear in normal Docker workflows,
including com.docker.image.source.entrypoint and Docker extension namespaces.
Dynamic keys are reported at info severity because they prevent static checks
from validating keys and finding duplicates. The old LABEL key value form is
left to BuildKit’s LegacyKeyValueFormat rule.
Examples
Bad
Good
Configuration
No custom configuration options. The rule is enabled by default with severitywarning.