lint_dockerfile
Lint a Dockerfile using Hadolint to identify best-practice and style issues such as unpinned base image versions, missing --no-install-recommends flags, and improper use of ADD or sudo.
Instructions
Lints a Dockerfile with Hadolint for best-practice and style issues —
unpinned package/base image versions, missing --no-install-recommends,
use of ADD instead of COPY, sudo usage, missing WORKDIR before relative
paths, and similar. Complements scan_dockerfile (Trivy), which focuses
on security misconfigurations rather than style/best-practice rules.
Requires the hadolint CLI installed and on PATH
(https://github.com/hadolint/hadolint).
Args: dockerfile_path: full path to an existing Dockerfile on this machine. Accepts either a Windows path ("C:\path\Dockerfile") or a Git Bash style path ("/c/path/Dockerfile").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dockerfile_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |