Hadolint is Dockerfile linter, validate inline bash, written in Haskell
It wasn’t made recently, it was born in 2016.
A smarter Dockerfile linter that helps you build best practice Docker images. The linter parses the Dockerfile into an AST and performs rules on top of the AST. It stands on the shoulders of ShellCheck to lint the Bash code inside RUN instructions.
1
> brew install hadolint
1
2
3
4
5
> hadolint Dockerfile
Dockerfile:1 DL3007 warning: Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag
// ignore DL3007.
> hadolint --ignore DL3007 Dockerfile
Use configurtion files .hadolint.yaml
1
2
3
ignored:
- DL3007
- SC1010
There is an official hadolint extension.