Labels defined in the schema must have a non-empty value. Hadolint only
evaluates this rule when a label schema or --require-label is
provided. If a required key appears with an empty value (after trimming
whitespace), a finding is reported.
Dockerfile
FROM alpine:3.19
LABEL org.opencontainers.image.source=""
Dockerfile
FROM alpine:3.19
LABEL org.opencontainers.image.source="https://example.org/repo" # compliant
When the same label key is assigned multiple times, the last assignment is used. Only the final value is checked.
Dockerfile
FROM scratch
LABEL foo="" # ignored
LABEL foo="bar" # OK
Whitespace-only values are also considered empty:
Dockerfile
FROM scratch
LABEL foo=" "
(c) 2025 Asymmetric Effort, LLC. scaldwell@asymmetric-effort.com
