Skip to content

no-latest-tag

Dockerfilesuspiciousno fixdefault: offdockerfile/hadolint

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.

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.

Reported
FROM alpine:latest
...
dockerfile:
lint:
rules:
no-latest-tag: warn # off (default), warn, error

Enabled by the presets: dockerfile/hadolint.

Suppress one line with sudsy-disable-next-line no-latest-tag 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 DL3007 full