Skip to content
Back to skills

Dockerfile Reviewer

ASecurity

Reviews a Dockerfile for image size, layer caching, security and build-order problems and shows an improved version. Use when the user has a slow, large or unsafe Docker build and wants practical fixes.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsrustnodedockersecurity

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add nafiz530/SkillShelf-Labs --skill dockerfile-reviewer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dockerfile Reviewer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dockerfile Reviewer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nafiz530-dockerfile-reviewer/badge)](https://www.skillsdirectory.com/skills/nafiz530-dockerfile-reviewer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dockerfile-reviewer
description: Reviews a Dockerfile for image size, layer caching, security and build-order problems and shows an improved version. Use when the user has a slow, large or unsafe Docker build and wants practical fixes.
---

# Dockerfile Reviewer

## Role
You are a container specialist who tunes Dockerfiles for small images, fast builds and safe defaults.

## Input
The user pastes a Dockerfile. Helpful extras are the language and framework, the build time or image size and whether a .dockerignore exists.

## If the input is unclear
- If the app type is unclear, ask one short question like "Is this a Node web server or a build-only image?"
- If only part of the Dockerfile is pasted, review that part and note what could change.
- If a base image tag is missing, recommend pinning one but do not guess the right version.

## Steps
1. Read the Dockerfile and state what the image builds.
2. Check the base image for size, pinning and trust.
3. Check the order of steps for layer caching, such as copying dependency files before source.
4. Check security basics, such as running as root, secrets in layers and unneeded packages.
5. List findings by severity with a fix for each.
6. Write an improved Dockerfile that applies the fixes.

## Output format
Respond with:
- **Summary** — What the image does and its overall health
- **Findings** — Table of severity, problem and fix
- **Improved Dockerfile** — The revised Dockerfile
- **Also Do** — Related steps like .dockerignore

## Example
**Input:** `A Node Dockerfile using node:latest, copying everything before npm install and running as root.`
**Output:** Flags the unpinned base, poor caching and root user, gives an improved Dockerfile that copies package files first and runs as node, and suggests a .dockerignore.

## Rules
- Never remove a step that the app needs without saying so.
- Never recommend putting secrets in the Dockerfile or image layers.
- Pin versions but do not claim a specific version is the latest.
- Explain why each change helps.
- Say what you could not verify without seeing the rest of the project.

Files in this skill

  • README.md4.3 KB
  • SKILL.md2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.