Dockerfile & Container Reviewer
/install container-reviewer
dockerfile-reviewer
Description
Review Dockerfiles and docker-compose files for security vulnerabilities, oversized images, build inefficiencies, and missing best practices. Returns a structured report with severity ratings and corrected examples.
Use when
- "review my Dockerfile"
- "is this container secure"
- "optimize my docker build"
- "why is my image so large"
- "check my docker-compose"
- Any Dockerfile, docker-compose.yml, or .dockerignore
Input
Paste the Dockerfile and/or docker-compose.yml. Optionally specify:
- Target environment (production, CI, local dev)
- Base image constraints (must use specific distro, etc.)
- Whether the app runs as a service or a one-shot job
Output format
## Dockerfile Review
### Critical (fix before production)
- [Finding] — [security or correctness risk]
✗ Before: [problematic line(s)]
✓ After: [corrected line(s)]
### Warnings (should fix)
- [Finding] — [size or reliability impact]
### Suggestions (nice to have)
- [Finding] — [explanation]
### What's correct
- [Specific patterns done right]
### Summary
[2–3 sentences: biggest risk, estimated image size savings if any, top fix]
Review checklist
Security
- Running as
root(noUSERdirective) — container escape risk - Secret or credential in
ENV,ARG, orRUNlayer — visible in image history - Base image not pinned (
FROM ubuntu:latestinstead ofubuntu:22.04) — supply chain risk - Using
curl | bashto install software — arbitrary code execution - Unnecessary packages installed (attack surface)
- No
HEALTHCHECK— orchestrator can't detect unhealthy containers - Writable filesystem where read-only would suffice
Image size
- Large base image when
alpineordistrolesswould work - Installing dev tools in production image (compilers, debuggers, test frameworks)
- Multiple
RUNcommands that should be chained with&&(each RUN = a layer) COPY . .before dependency install (cache busting on every code change)- Not using
.dockerignore— copying node_modules, .git, build artifacts - Leftover apt/apk cache not cleaned in same RUN layer
Build correctness
- Wrong
WORKDIR— files land in unexpected paths EXPOSEport doesn't match what the app actually listens onCMDvsENTRYPOINTconfusion — CMD should be overridable args, ENTRYPOINT the executable- Using
ADDwhenCOPYis sufficient (ADDhas implicit tar extraction and URL fetch) - Build args used as secrets (visible in
docker history)
docker-compose specific
- No
restartpolicy — containers don't recover from crashes - Hardcoded secrets in
environment:block — use.envor secrets - Named volumes not defined in
volumes:section - Port binding to
0.0.0.0when127.0.0.1would suffice - No resource limits (
mem_limit,cpus) — one container can starve others - Depends_on without
condition: service_healthy— race conditions on startup
Multi-stage build
- Single-stage build for compiled language — ships compiler in production image
- Build artifacts not properly copied from builder stage
- Redundant stages that could be merged
Severity definitions
- Critical: Security vulnerability or correctness bug that affects production
- Warning: Image bloat, reliability issue, or hard-to-debug behavior
- Suggestion: Style, caching efficiency, or future-proofing improvement
Self-improvement instructions
After each review, note the most impactful finding. After 20 reviews, surface "Top 3 Dockerfile mistakes" at the start of the response.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install container-reviewer - After installation, invoke the skill by name or use
/container-reviewer - Provide required inputs per the skill's parameter spec and get structured output
What is Dockerfile & Container Reviewer?
Reviews Dockerfiles and docker-compose files for security, size, build, and best practice issues, providing a detailed severity-rated report with fixes. It is an AI Agent Skill for Claude Code / OpenClaw, with 187 downloads so far.
How do I install Dockerfile & Container Reviewer?
Run "/install container-reviewer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Dockerfile & Container Reviewer free?
Yes, Dockerfile & Container Reviewer is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Dockerfile & Container Reviewer support?
Dockerfile & Container Reviewer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Dockerfile & Container Reviewer?
It is built and maintained by Lnguyen1996 (@lnguyen1996); the current version is v1.0.0.