Skip to content

Validation fail with DL3061 error when Dockerfile begin with comment that start with 'syntax'  #795

@StefanoGuerrini

Description

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

Expected behaviour

Success

Actual behaviour

DL3061 error: Invalid instruction order. Dockerfile must begin with FROM, ARG or comment.

Steps to reproduce the behaviour

A Dockerfile that begin with a comment that starts with 'syntax'

Run:
docker run --rm -i hadolint/hadolint:latest hadolint "$@" - < Dockerfile

Version:
Haskell Dockerfile Linter v2.9.1-0-g42d0378-dirty

Error:

-:1 DL3061 error: Invalid instruction order. Dockerfile must begin with `FROM`, `ARG` or comment.

Dockerfile

# syntax=something
ARG FOO=BAR
FROM debian:8

Additional environment details (OS, stack version, etc.)
Using hadolint/hadolint:2.8.0-debian works

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