# Docker Configuration Validator

Validates Dockerfiles and Docker Compose files for security, syntax and modern requirements. Useful before shipping to production.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 336 installs · ★ 86
- Author: rknall
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/rknall/claude-skills/tree/HEAD/docker-validation/SKILL.md
- Updated: 2025-10-20
- HTML: https://affpapa.org/en/nevibecode/skills/docker-configuration-validator

## What it does

The skill walks through validation in phases: first it scopes the job — one file or a whole project — then checks Dockerfiles, then Compose. It ships with ready commands: finding files with `find`, running Hadolint and DCLint when they are installed, and `docker compose config --quiet` for syntax. If the linters are missing, it falls back to manual checks from a checklist.

The manual pass looks for `:latest` tags, a missing `USER` directive with a non-root account, secrets baked into the image, relative paths in `WORKDIR`. For multi-stage builds it counts `FROM` statements, named stages and `COPY --from=` to see whether artifacts actually move between stages. Findings land in four buckets: critical, high, medium, low.

On the Compose side it flags the obsolete `version` field — Compose v2.27.0 and later dropped it. Then networks, volumes, environment variables, restart policies and healthchecks. The skill does not install Hadolint or DCLint itself, it suggests you do; without them you are left with the manual checks only, so confirm both are on your PATH before you run it.

## Requirements
- Works with: Docker

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add rknall/claude-skills --skill docker-configuration-validator -a claude-code
```
```bash
npx skills add rknall/claude-skills --skill docker-validation -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/docker-validation/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/docker-validation/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add rknall/claude-skills --skill docker-validation -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/docker-validation/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add rknall/claude-skills --skill docker-validation -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/docker-validation/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install rknall/claude-skills docker-validation
```

2. **Manually: put the files in place**
- File: `.github/skills/docker-validation/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add rknall/claude-skills --skill docker-validation -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/rknall/claude-skills --path docker-validation
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/docker-validation/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add rknall/claude-skills --skill docker-validation -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/rknall/claude-skills/tree/HEAD/docker-validation/SKILL.md

## When to use it
- find every Dockerfile in a project and check each one
- drop `:latest` tags and pin base image versions
- verify the container does not run as root
- confirm a multi-stage build actually carries artifacts over
- strip the obsolete `version` field from Compose

## Example prompts
- check my Dockerfile for security issues and best practices
- run validation on docker-compose.yml and list problems by severity
- review the multi-stage build: do artifacts move between stages?

## Similar
- [docker-patterns](https://affpapa.org/en/nevibecode/skills/docker-patterns.md) — skill · 6400 installs
- [docker-compose-production](https://affpapa.org/en/nevibecode/skills/docker-compose-production.md) — skill · 484 installs
- [docker-development](https://affpapa.org/en/nevibecode/skills/docker-development.md) — skill · 702 installs
- [docker-compose-patterns](https://affpapa.org/en/nevibecode/skills/docker-compose-patterns.md) — skill · 1400 installs
- [docker-project-foundations](https://affpapa.org/en/nevibecode/skills/docker-project-foundations.md) — skill · 1000 installs
- [docker](https://affpapa.org/en/nevibecode/skills/bobmatnyc-docker.md) — skill · 1000 installs

From the same set: [rknall/claude-skills](https://affpapa.org/en/nevibecode/by/rknall/claude-skills.md) — 4 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
