Skip to content

untagged-base-image

Dockerfilesuspiciousno fixdefault: offdockerfile/hadolint

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.

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.

Reported
FROM alpine
FROM alpine:3 AS build
FROM build
FROM scratch
...
FROM $BASE
...
FROM BUILD
FROM localhost:5000/img
FROM localhost:5000/img:1
FROM alpine@sha256:abc
USER root
...
dockerfile:
lint:
rules:
untagged-base-image: warn # off (default), warn, error

Enabled by the presets: dockerfile/hadolint.

Suppress one line with sudsy-disable-next-line untagged-base-image 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 DL3006 full