A smarter Dockerfile linter that helps you build best practice Docker images by parsing the AST and linting inline Bash.
Hadolint is a Dockerfile linter that analyzes Dockerfiles for syntax errors and best practice violations. It helps developers build secure, efficient, and maintainable Docker images by applying rules based on Docker's official best practices and linting inline Bash code using ShellCheck.
DevOps engineers, platform engineers, and developers who build and maintain Docker images and want to enforce security and efficiency standards in their container pipelines.
Hadolint provides deeper analysis than basic linters by parsing the Dockerfile AST and integrating ShellCheck, offering comprehensive rule coverage, flexible configuration, and seamless CI/CD integration to catch issues early.
Dockerfile linter, validate inline bash, written in Haskell
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Parses Dockerfiles into an Abstract Syntax Tree for accurate rule application, avoiding simple pattern matching as described in the README.
Leverages ShellCheck to validate Bash code within RUN instructions, catching shell-specific issues like SC2086 for unquoted variables.
Over 100 rules cover security, efficiency, and maintainability, such as DL3006 for image tagging and DL3002 for avoiding root user.
Supports config files, environment variables, and inline ignore pragmas, allowing fine-grained control as shown in the Configure section.
Only identifies issues without providing automated corrections, requiring manual intervention to fix Dockerfiles, which the README doesn't address.
Full functionality depends on ShellCheck for Bash linting, which might require separate installation or management, adding complexity.
Configuration file lookup involves multiple locations (e.g., $PWD/.hadolint.yaml, $HOME/.config/hadolint.yaml), which can be confusing to manage.