dockerfile-validator

Validate Dockerfiles with hadolint and Checkov for security and best practices.

7|3|Updated May 4, 2026
One-click install
npx skills add https://github.com/nopperabbo/codebuddy2api --skill dockerfile-validator-nopperabbo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dockerfile-validator
Source: https://github.com/nopperabbo/codebuddy2api/tree/main/opencode-config/skills/dockerfile-validator
Command: npx skills add https://github.com/nopperabbo/codebuddy2api --skill dockerfile-validator-nopperabbo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python3, hadolint, checkov, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Validates Dockerfiles to ensure syntax correctness, security considerations, and adherence to best practices, enabling faster secure builds and reliable deployments.

Core Features & Use Cases

  • Deterministic validation workflow that processes Dockerfiles from a repo root.
  • Syntax checking (hadolint), security scanning (Checkov), and best-practices checks with custom rules.
  • Auto-installation of validation tools if not present, and generation of a structured, severity-based report.
  • Guidance for fixes and optional fallback behaviors when tools are unavailable.

Quick Start

Run the dockerfile-validator script against a Dockerfile to perform the full validation.

Frequently Asked Questions about dockerfile-validator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate a Dockerfile for security and best practices?

Dockerfile validation checks syntax correctness, security configurations, and adherence to best practices to detect insecure layering. It applies to local development, CI pipelines, and code reviews to ensure faster secure builds.

Does Dockerfile security scanning work with hadolint and checkov?

Dockerfile security scanning integrates hadolint for syntax checking and checkov for security scanning. The validator auto-installs these tools if not present, running deterministic checks to produce severity-based findings.

What is the best way to lint Dockerfiles in a CI pipeline?

Linting Dockerfiles in a CI pipeline requires deterministic validation that processes files from a repo root to detect insecure configurations. It generates structured reports with severity-based findings and guidance for fixes.

Can I run Dockerfile validation locally without installing dependencies manually?

Dockerfile validation can run locally without manual setup by auto-installing required tools like hadolint and checkov. It includes optional fallback behaviors when tools are unavailable, ensuring deterministic execution.

Why should I use a Dockerfile validator instead of manual code reviews?

A Dockerfile validator provides deterministic security and best-practices checks that manual reviews miss, detecting syntax issues and poor layering. It produces structured reports with guidance for fixes, ensuring reliable deployments.

What do I need to run Dockerfile validation checks with Python?

Dockerfile validation requires Python3 as a dependency alongside auto-installed tools like hadolint and checkov. It processes Dockerfiles from a repository root to generate structured, severity-based reports.