Skip to content
Moritz Röhrich edited this page Mar 23, 2021 · 1 revision

Superfluous label(s) present.

This rule is only activated when linting with the strict-labels option. This can be specified via config file

strict-labels: true

or via command line:

$ hadolint --strict-labels Dockerfile

Note, that when no label-schema is specified, all labels are considered superfluous by this rule.

Problematic code:

FROM busybox
LABEL superfluous="this should not be here"

Correct code:

FROM busybox

Rationale:

In certain situations, it may be desirable to ensure no labels other than those specified in the label-schema are present. This may be required to avoid information leakage, to not confuse label parsers or to ensure compliance to standards.