An opinionated linter for Dockerfiles that enforces best practices and catches common mistakes.
dockerfilelint is a static analysis tool that validates Dockerfiles against a comprehensive set of rules to ensure they follow best practices. It helps developers avoid common pitfalls in Docker image construction, such as using insecure base images, inefficient layer caching, and improper package management. The tool can be integrated into development workflows and CI/CD pipelines to maintain consistent Dockerfile quality.
DevOps engineers, backend developers, and platform teams who regularly build and maintain Docker images and want to enforce consistency and security in their containerization process.
Developers choose dockerfilelint because it provides an opinionated, comprehensive rule set specifically tailored for Dockerfiles, with easy configuration and multiple integration options. Unlike generic linters, it understands Docker-specific syntax and best practices, helping teams standardize their container builds across projects.
An opinionated Dockerfile linter.
Covers over 30 rules targeting security and efficiency, such as avoiding latest tags and ensuring apt-get cleanup, as listed in the README.
Supports CLI, Docker container, npm module, and online tool (FromLatest.io), making it adaptable to various development and CI/CD workflows.
Allows disabling specific rules via a .dockerfilelintrc file, enabling teams to tailor linting to their standards without complexity.
Enforces best practices that prevent common vulnerabilities, like improper port exposure and missing package manager flags, based on community guidelines.
Only permits disabling existing rules; cannot add new rules or modify existing ones, which restricts adaptability to unique project needs.
The README admits missing checks for commands like ARG, ONBUILD, and advanced COPY validations, leaving gaps for users relying on these features.
Requires Node.js installation, which can be a barrier in environments not using JavaScript tooling, adding setup overhead.
As a Node.js application, it may have higher resource usage compared to native or compiled alternatives, especially for large-scale linting.
Dockerfile linter, validate inline bash, written in Haskell
Lightweight Dockerfile linter that helps you write better Dockerfiles. Get instant feedback with quality scores, security checks, and 60+ best practice rules.
:whale: Keep an eye on your docker image size and prevent it from growing too big
Dockerfile Linter is a tool that analyzes Dockerfiles to ensure they follow established best practices for creating efficient and secure Docker images. It helps developers catch common mistakes and optimize their Docker builds by validating syntax and providing actionable feedback. ## Key Features - **Rule-Based Validation** — Implements over 40 specific rules covering directives, instructions, and common anti-patterns. - **ShellCheck Integration** — Uses ShellCheck to analyze shell code within RUN instructions for additional safety. - **Flexible Ignore System** — Supports ignoring rules via inline comments, YAML configuration files, or CLI flags. - **CI/CD Ready** — Designed for integration into continuous integration and delivery pipelines with configurable error levels. - **Multiple Interfaces** — Can be used via CLI, Docker container, or natively within the Buddy CI/CD platform. ## Philosophy The linter emphasizes practical, actionable feedback to help developers build better Docker images by following documented best practices and avoiding common pitfalls.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.