Skip to content

[DL3025] False positive with multiline instruction #783

@CodingKoopa

Description

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

Expected behavior

hadolint permits the user to have a multi-line ENTRYPOINT or CMD, using exec form.

Actual behavior

hadolint raises DL3025 when the instruction is made to span multiple lines by escaping the newline.

Steps to reproduce the behavior

These do not raise an error, and are well-formed (that is, no issue here):

CMD [ "/bin/sh", "-c", "true;"]
CMD ["/bin/sh", "-c", \
  "true;"]

These do raise DL3025, but I think they are well-formed:

CMD ["/bin/sh", "-c", \
  "true; \
  true;"]
CMD ["/bin/sh", "-c", \
  "true && \
  true"]

These statements raise DL3025, but also are ill-formed for unrelated reasons:

CMD ["/bin/sh", "-c", \
  ]

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 UNKNOWN

(what I have installed is hadolint-bin 2.8.0-1 from the AUR.)

Thanks!

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