untagged-base-image
What it does
Section titled “What it does”Reports a FROM image with neither a tag nor a digest (FROM alpine). Docker reads it as :latest. Not reported: scratch, a variable ($BASE) and the name of an earlier stage (compared without case). A : in the registry host (localhost:5000/app) is a port, not a tag.
Why it matters
Section titled “Why it matters”An image without a tag is pulled as latest, so the Dockerfile does not even say which version it builds on. The base changes with each upstream release, and a rebuild can fail or behave differently with no change in the file.
Name a release (alpine:3.20) or a digest.
Example
Section titled “Example”FROM alpineFROM alpine:3 AS buildFROM buildFROM scratch...FROM $BASE...FROM BUILDFROM localhost:5000/imgFROM localhost:5000/img:1FROM alpine@sha256:abcUSER root...Configuration
Section titled “Configuration”dockerfile: lint: rules: untagged-base-image: warn # off (default), warn, errorEnabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line untagged-base-image 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 | DL3006 |
full |