Skip to main content

Hadolint Usage

Hadolint CLI Usage

hadolint <Dockerfile>
hadolint --trusted-registry my-company.com:500 <Dockerfile> # Warn when using untrusted FROM images
hadolint --trusted-registry my-company.com:500 <Dockerfile> # Warn when using untrusted FROM images

Hadolint Docker Container Usage

Docker comes to the rescue, providing an easy way how to run hadolint on most platforms. Just pipe your Dockerfile to docker run:

docker run --rm -i hadolint/hadolint < Dockerfile

OR

docker run --rm -i ghcr.io/hadolint/hadolint < Dockerfile

Hadolint Podman Usage

podman run --rm -i docker.io/hadolint/hadolint < Dockerfile

OR

podman run --rm -i ghcr.io/hadolint/hadolint < Dockerfile

Hadolint Windows Powershell Usage

cat .\Dockerfile | docker run --rm -i hadolint/hadolint