no-from-platform
What it does
Section titled “What it does”Reports a FROM with a fixed --platform, such as --platform=linux/amd64. A value that contains $BUILDPLATFORM or $TARGETPLATFORM is not reported; other variables such as $TARGETARCH are.
Why it matters
Section titled “Why it matters”A fixed platform ties the build to one CPU architecture. On an arm64 machine the base image is pulled for amd64 and runs under emulation, which is slow and sometimes breaks, and a multi-platform build produces the same amd64 content for every target.
Without the option the base follows the platform of the build; a stage that must run on the build machine uses --platform=$BUILDPLATFORM.
Example
Section titled “Example”...FROM --platform=linux/amd64 alpine:3...FROM alpine:3@sha256:abc...Configuration
Section titled “Configuration”dockerfile: lint: rules: no-from-platform: warn # off (default), warn, errorEnabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line no-from-platform in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| hadolint | DL3029 |
full |