Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

hadolint

Stow package for ~/.config/hadolint/config.yaml. hadolint is a Dockerfile linter. Used by lefthook on pre-commit and by hand.

Table of contents

Layout

FileStows to
hadolint/.config/hadolint/config.yaml~/.config/hadolint/config.yaml

Settings

Ignored rules:

CodeRuleWhy ignored
DL3008apt-get without version pinunpinned apt is fine in scratch/dev images
DL3018apk add without version pinsame logic for Alpine
DL3015apt-get without --no-install-recommendsstylistic preference

Trusted registries (skip “use a versioned tag” warnings for these): docker.io, gcr.io, quay.io, ghcr.io, registry.k8s.io, public.ecr.aws.

failure-threshold: warning makes hadolint exit non-zero only for warning/error rules — informational findings don’t fail builds.

Per-project overrides

A repo can drop a .hadolint.yaml at the root; it wins. Per-line disables also work:

# hadolint ignore=DL3007
FROM nginx:latest

Fresh-machine setup

brew install hadolint    # in the Brewfile
stow hadolint