Skip to content

3061: False positive for ONBUILD commands #798

@cronik

Description

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

Expected behavior

3061 should not be triggered for ONBUILD commands.

Actual behavior

Hadolint rule 3061 is triggered for valid ONBUILD commands.

Steps to reproduce the behavior

❯ docker run --rm -i hadolint/hadolint:2.9.1-alpine < Dockerfile
-:2 DL3061 error: Invalid instruction order. Dockerfile must begin with `FROM`, `ARG` or comment.

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

❯ docker run --rm -i hadolint/hadolint:2.9.1-alpine hadolint --version
Haskell Dockerfile Linter v2.9.1-0-g42d0378-dirty

Dockerfile (if relevant)

FROM busybox:1.35
ONBUILD COPY foo.txt /

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