Skip to content

Add check to match FromAsCasing Docker build check #1026

Open
@jnoordsij

Description

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

Expected behavior

Docker has some build checks, which may raise warnings when building images that are incorrect or inconsistent in some way; see also https://docs.docker.com/reference/build-checks/.

The FromAsCasing check tests whether or not the FROM and AS keywords are consistently using the same casing in any instruction. If this is not consistent, recent Docker versions (tested on 27.0.1) issue a warning FromAsCasing: 'as' and 'FROM' keywords' casing do not match.

However, hadolint does not report any error on a Dockerfile violating this rule. I would expect it to do so, given it is a pattern

Actual behavior

Building with docker reports a warning, hadolint does not.

Steps to reproduce the behavior

  1. Create Dockerfile as listed below and run hadolint: no warning appears
  2. Build Dockerfile with Docker 27.0.1: warning appears

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

hadolint --version
> Haskell Dockerfile Linter 2.12.0

Dockerfile (if relevant)

FROM debian:latest as builder

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

N/A

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