Skip to content

Allow $BUILDPLATFORM in DL3029 #772

@StefanSchoof

Description

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

Expected behavior

docker is promoting to use $BUILDPLATFORM in a FROM statement: https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/

Using $BUILDPLATFORM in the FROM should not trigger DL3029, because the negative consequences that are mentions there are not valid when use $BUILDPLATFORM.

FROM --platform=$BUILDPLATFORM composer:2 AS builder

Actual behavior

A FROM --platform=$BUILDPLATFORM produces a DL3029

Steps to reproduce the behavior

Use FROM --platform=$BUILDPLATFORM and run hadolint.

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

(is 2.8.0, see #735)

Dockerfile (if relevant)

FROM --platform=$BUILDPLATFORM composer:2 AS builder

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