no-latest-tag
What it does
Section titled “What it does”Reports a FROM whose image has the tag latest (alpine:latest). A latest image with a digest (alpine:latest@sha256:...) is not reported; an image with no tag at all is the business of untagged-base-image.
Why it matters
Section titled “Why it matters”latest is only a name that the image’s owner moves to each new release. The base of your image then changes without any edit in the Dockerfile: a rebuild can pull a new major version of the operating system or runtime, and a build that worked yesterday fails or behaves differently today.
A release tag (alpine:3.20) or a digest keeps the base fixed.
Example
Section titled “Example”FROM alpine:latest...Configuration
Section titled “Configuration”dockerfile: lint: rules: no-latest-tag: warn # off (default), warn, errorEnabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line no-latest-tag 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 | DL3007 |
full |