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

Label <label> is not a valid SPDX license identifier.

This rule is activated by specifying a label-schema including a label of the type spdx

label-schema:
  license: spdx

or via command line:

# hadolint --require-label license:spdx Dockerfile

Problematic code:

LABEL license="Thou shall not copyright infringe"

Correct code:

LABEL license="BSD-3-Clause"

Rationale:

This rule allows users to ensure a label contains a literal SPDX license identifier. This may be desirable as part of the release process, to ensure images released are properly licensed and the license can be detected by automated tools.

Note:

This rule does not expand variables. The value of the label must be a literal SPDX license identifier. A list of valid license identifiers can be found here.