hadolint is the first pick for most teams. It is a free, open-source linter that checks Dockerfile syntax, shell best practices and common mistakes, and it runs as a single binary, a Docker image or a CI step. For policy and security checks beyond linting, Checkov and Trivy are good alternatives. Both scan Dockerfiles alongside other artifacts and fit teams that already run security tooling in CI.
We run no ads and no affiliate links at launch. The order of a list follows our published method.
Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.
Key takeaways
hadolint is free and open source, runs locally and in CI, and needs no account or data upload.
Checkov and Trivy are free open-source scanners that cover Dockerfile misconfigurations and container image issues.
Docker Build checks ship with BuildKit and run during a build, so no extra tool is needed for basic validation.
Most of these tools run locally or in your own CI, which keeps Dockerfile contents off third-party web pages.
Tool
Best for
Standout feature
Listed starting price
Free plan or trial
1 hadolint
Fast Dockerfile linting in local dev and CI
Single binary with no runtime dependencies
Free (open source)
Free plan
2 Checkov
Policy-as-code checks across IaC and Dockerfiles
Covers Dockerfiles plus Terraform, Kubernetes and more
Free (open source)
Free plan
3 Trivy
Dockerfile misconfiguration plus image vulnerability scans
One tool for config scanning and image CVEs
Free (open source)
Free plan
4 Docker Build checks
Built-in Dockerfile validation during docker build
No extra install beyond Docker
Free
Free plan
5 Dockle
Container image best-practice and CIS checks
Checks image configuration and filesystem issues
Free (open source)
Free plan
6 KICS
Open-source IaC scanning that includes Dockerfiles
Large query library across many IaC formats
Free (open source)
Free plan
7 Conftest
Custom Dockerfile policies with Rego
Write your own rules in Rego
Free (open source)
Free plan
How we picked
We picked tools that actually lint or scan Dockerfiles, not general container platforms. Criteria were fit for Dockerfile checks, supported platforms and install methods, licence and price, whether checks run locally or in your own CI, and the main limits of each tool. Details come from vendor documentation, project repositories and public pricing pages. Prices and free-plan terms can change, so confirm them on the vendor site before you commit.
01
hadolint
Best for: Fast Dockerfile linting in local dev and CI
hadolint parses a Dockerfile and reports issues by rule code, from deprecated instructions to shell problems inside RUN commands. It embeds ShellCheck so it can flag unsafe shell patterns in a single pass. Configuration lives in a YAML file, so teams can ignore rules or set severity levels per repository.
It runs on Linux, macOS and Windows, and is also published as a Docker image and a GitHub Action. Because it is a static binary, it fits air-gapped and offline environments. There is no paid tier and no hosted service, so results stay on your machine or CI runner. Teams that need broad cloud policy checks should pair it with a scanner such as Checkov.
Pros
Single binary with no runtime dependencies
ShellCheck integration for RUN lines
Cons
No built-in policy engine for org-wide rules
Limited to Dockerfile checks
Price: Free (open source), as listed by the vendor (hadolint website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: no built-in policy engine for org-wide rules.
Verdict. A sensible pick for fast Dockerfile linting in local dev and CI.
02
Checkov
Best for: Policy-as-code checks across IaC and Dockerfiles
Checkov is an open-source static analysis tool from Prisma Cloud (Palo Alto Networks). It includes Dockerfile policies such as running as root, using latest tags and missing health checks, and reports them next to findings from other infrastructure files. That makes it useful when a repo mixes Dockerfiles with Kubernetes manifests or Terraform.
It runs on Python and is available as a CLI, a Docker image and CI integrations. Rules can be skipped inline or through config files, and custom policies are supported. The open-source CLI is free; the vendor sells a commercial platform for broader coverage. Small projects that only need Dockerfile style checks may find hadolint lighter.
Pros
Covers Dockerfiles plus Terraform, Kubernetes and more
Custom policies in Python or YAML
Cons
Heavier install than a single binary
Output can be noisy on large repos
Price: Free (open source), as listed by the vendor (Checkov website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: heavier install than a single binary.
Verdict. A sensible pick for policy-as-code checks across IaC and Dockerfiles.
03
Trivy
Best for: Dockerfile misconfiguration plus image vulnerability scans
Trivy from Aqua Security scans container images, filesystems, repositories and infrastructure files. Its misconfiguration scanner includes Dockerfile checks, and its image scanner reports known vulnerabilities in packages. Teams often run it once in CI to cover both the Dockerfile and the built image.
It is a single binary for Linux, macOS and Windows, and it also runs as a Docker image. The vulnerability database is downloaded and cached, so first runs need network access unless you mirror it. Trivy is free and open source. If you only want Dockerfile linting, hadolint gives more focused rule messages.
Pros
One tool for config scanning and image CVEs
Wide CI and registry support
Cons
Dockerfile lint rules are a smaller part of the tool
Database updates need network access
Price: Free (open source), as listed by the vendor (Trivy website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: dockerfile lint rules are a smaller part of the tool.
Verdict. A sensible pick for dockerfile misconfiguration plus image vulnerability scans.
04
Docker Build checks
Best for: Built-in Dockerfile validation during docker build
Docker Build checks are warnings and errors that BuildKit reports while building an image. They flag issues such as invalid instructions, stage names that are never used and problems with recommended practices. You see them in build output, and you can raise the checks to errors so a build fails.
Because the checks come with Docker itself, there is nothing extra to install or license. They are a good baseline for teams already building with BuildKit. They do not replace a dedicated linter for shell-level checks or custom policy, so many teams run Build checks plus hadolint.
Pros
No extra install beyond Docker
Runs automatically with BuildKit builds
Cons
Fewer rules than dedicated linters
Tied to the Docker build workflow
Price: Free, as listed by the vendor (Docker Build checks website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: fewer rules than dedicated linters.
Verdict. A sensible pick for built-in Dockerfile validation during docker build.
05
Dockle
Best for: Container image best-practice and CIS checks
Dockle inspects a built container image and reports best-practice and CIS Benchmark style issues, such as running as root, exposed credentials in environment variables and unnecessary setuid files. It complements a Dockerfile linter by checking the result rather than the source.
It runs as a binary or a Docker image and fits a CI step after the image build. It is free and open source. Because it needs a built image, it is slower than text-based linting and less useful for quick local checks during editing.
Pros
Checks image configuration and filesystem issues
Simple CLI output
Cons
Works on built images, not Dockerfile text
Fewer Dockerfile-specific rules
Price: Free (open source), as listed by the vendor (Dockle website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: works on built images, not Dockerfile text.
Verdict. A sensible pick for container image best-practice and CIS checks.
06
KICS
Best for: Open-source IaC scanning that includes Dockerfiles
KICS from Checkmarx is an open-source scanner for infrastructure as code. It includes Dockerfile queries and reports findings in JSON, SARIF and other formats that plug into CI dashboards. It suits teams that want one scanner across Docker, Kubernetes, Terraform and cloud templates.
It runs as a binary, a Docker image or a CI action, and queries can be selected or excluded. It is free and open source. The tool is broad, so expect some configuration to focus on Dockerfile rules. For a single-purpose linter, hadolint is simpler.
Pros
Large query library across many IaC formats
Multiple output formats for CI
Cons
Dockerfile coverage is one part of a broad tool
Setup and query tuning take time
Price: Free (open source), as listed by the vendor (KICS website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: dockerfile coverage is one part of a broad tool.
Verdict. A sensible pick for open-source IaC scanning that includes Dockerfiles.
07
Conftest
Best for: Custom Dockerfile policies with Rego
Conftest from Open Policy Agent lets you write policies in Rego and run them against structured config, including Dockerfile parsing through its parsers. It is a framework rather than a rule pack, so you define the checks your team needs, such as required labels or banned base images.
It runs as a binary and in CI, and it is free and open source. The trade-off is effort: you get full control but must write and maintain policies. Teams that want ready rules out of the box should start with hadolint or Checkov.
Pros
Write your own rules in Rego
Works across many config formats
Cons
You maintain the policies yourself
No ready-made Dockerfile rule set
Price: Free (open source), as listed by the vendor (Conftest website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: you maintain the policies yourself.
Verdict. A sensible pick for custom Dockerfile policies with Rego.
Who should use what
A solo developer who wants fast feedback while editing should use hadolint locally and add Docker Build checks for free baseline warnings. A platform team enforcing rules across many repos should use Checkov or KICS for policy-as-code coverage. A security team that also needs image vulnerability data should run Trivy. A team with unusual internal rules should use Conftest and write its own Rego policies.
What to check before you buy
Confirm the tool reads Dockerfile text directly if you want fast pre-build checks.
Check that it runs offline or in your CI so Dockerfile contents stay internal.
Review the rule set and how to ignore or adjust rules per repository.
Verify CI integration and output formats such as SARIF or JSON.
Confirm the licence and any paid tier terms on the vendor page.
FAQ
What is the best Dockerfile linter overall?
hadolint is the most focused free option for Dockerfile linting. It checks syntax, best practices and shell commands in RUN lines, and runs as a single binary or Docker image. Teams that also need policy or security scanning often add Checkov or Trivy.
Are these Dockerfile linters free?
hadolint, Checkov, Trivy, Dockle, KICS and Conftest are free and open source. Docker Build checks come with Docker at no extra cost. Some vendors sell commercial platforms alongside their open-source tools, so check the vendor page for paid features.
Can I lint a Dockerfile without sending it to a third-party service?
Yes. All the tools listed run locally, as a Docker image or in your own CI. That keeps Dockerfile contents on your infrastructure. Avoid pasting Dockerfiles with secrets, tokens or internal hostnames into any third-party web page.
Do I need a linter if Docker Build checks already run?
Docker Build checks catch basic problems during a build. A dedicated linter adds more rules, including shell checks and custom policy. Many teams run both: Build checks for free baseline validation and hadolint for deeper Dockerfile review.
Which tool checks the built image rather than the Dockerfile?
Dockle and Trivy inspect built images. Dockle reports image configuration and filesystem best-practice issues, and Trivy reports package vulnerabilities plus misconfigurations. Use them after the image build, alongside a Dockerfile linter.