Dockerfile linter that checks best practices and the shell in RUN lines
open sourceGPL-3.0-onlyfree
Hadolint is an open source Dockerfile linter that parses a Dockerfile into an abstract syntax tree and checks it against best-practice rules for building Docker images, and uses ShellCheck to lint the Bash code inside RUN instructions. Rules can be ignored inline or globally, labels can be linted against a schema, untrusted base image registries can be flagged, and results come out in formats for CI and editors. It runs as a single binary for macOS, Windows and Linux, as a container image, or in the browser on its website. It's written in Haskell under the GPL-3.0 licence.
Ways to install
Package managers
Problems it solves
- catch mistakes and bad practices in my Dockerfile before building the image
- fail the CI build when a Dockerfile breaks our container guidelines
- check the shell commands in Dockerfile RUN lines for bugs
Features
- Dockerfile best-practice rules
- ShellCheck linting of RUN instructions
- inline and global rule ignores
- label linting
- trusted registry checks
- CI-friendly output formats
- online version in the browser
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what Hadolint does.
- ShellCheck A shell script static analysis tool