Skip to content

no-redundant-target-platform

Dockerfilecleanupno fixdefault: offdockerfile/hadolint

Reports a FROM with --platform=$TARGETPLATFORM (or ${TARGETPLATFORM}), which is what FROM does without the option.

The target platform is already the default platform of a FROM, so the option changes nothing and only makes a reader look for what it does. Drop it.

Reported
...
FROM --platform=$TARGETPLATFORM alpine:3
...
FROM alpine:3@sha256:abc
...
dockerfile:
lint:
rules:
no-redundant-target-platform: warn # off (default), warn, error

Enabled by the presets: dockerfile/hadolint.

Suppress one line with sudsy-disable-next-line no-redundant-target-platform in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
hadolint DL3065 full