Skip to content

DNF Rule "Specify Version" Not Applying to dnf-plugins-core #1002

@oliverisaac

Description

@oliverisaac
  • This is a bug report
  • I searched existing issues before opening this one

Expected behavior

I would expect a docker line of:

RUN dnf install -y dnf-plugins-core \
    && dnf clean all

To return an error of:

-:5 DL3041 warning: Specify version with `dnf install -y <package>-<version>`.

Actual behavior

Hadolint runs successfully with no errors.

Steps to reproduce the behavior

Use this dockerfile:

FROM rockylinux:9.3
RUN dnf install -y dnf-plugins-core \
    && dnf clean all

And run hadolint against it.

This oneliner works:

printf "%s\n" "FROM rockylinux:9.3" "RUN dnf install -y dnf-plugins-core && dnf clean all" | docker run --rm -i hadolint/hadolint

If you add, e.g., openssl to the install command then it works as expected:

$ printf "%s\n" "FROM rockylinux:9.3" "RUN dnf install -y openssl dnf-plugins-core && dnf clean all" | docker run --rm -i hadolint/hadolint
-:2 DL3041 warning: Specify version with `dnf install -y <package>-<version>`.

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

Haskell Dockerfile Linter 2.12.1

Dockerfile (if relevant)

FROM rockylinux:9.3
RUN dnf install -y dnf-plugins-core \
    && dnf clean all

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions