Skip to content

DL3048 does not accept underscore and slash as valid char in LABEL key #1035

@mschmeitz

Description

@mschmeitz
  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

LABEL org.opencontainers.image.authors="Me"   # passed DL3048 check
LABEL my.label/with_underscore="Illegal underscore and slash"   # should pass the DL3048 check

Actual behavior

Slashes and Underscores are not accepted in the LABEL key.
The following definition should pass but is reported as a failure:

LABEL my.label/with_underscore="Illegal underscore and slash"  

Steps to reproduce the behavior

See above

This is expected, since the code of DL3048 defines the allowed characters.
See https://hackage.haskell.org/package/hadolint-2.12.0/docs/src/Hadolint.Rule.DL3048.html#containsIllegalChar
specifically the line:

validChars = ['0'..'9'] ++ ['a' .. 'z'] ++ ['.', '-']

PR: #1034

Output of hadolint --version or
docker run --rm hadolint/hadolint hadolint --version or
docker run --rm ghcr.io/hadolint/hadolint hadolint --version:

2.12.0

Additional environment details (OS, stack version, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions