hermes

Review a Dockerfile

Reviews a Dockerfile for security, image size, build cache use and runtime correctness, and returns ranked findings with a corrected file. Use before shipping a new or changed container image.

context

A Dockerfile decides what ships to production: which base image and its vulnerabilities, which user the process runs as, whether secrets end up in a layer, and how long every build takes. Most problems are invisible until an image is scanned, pulled at scale or stopped mid-request.

task

Review . If it is a path, read it, plus .dockerignore and the files it copies. Only if [RUNTIME] is given: It runs as: Weight your attention toward: .

Check, citing the line for each issue:

  1. Base image: a specific version tag (never latest), ideally pinned by digest; a slim or distroless variant where the app allows it; the same family across stages.
  2. Stages: build tools, compilers and dev dependencies stay in a build stage; the final stage copies only the artefacts it needs.
  3. Secrets: no credentials in ARG, ENV, copied files or the build context. Build-time secrets use BuildKit secret mounts.
  4. User: the final stage runs as a non-root user with a fixed UID, and files it does not need to write are not owned by it.
  5. Cache order: dependency manifests and lockfiles are copied and installed before the source, so a code change does not reinstall dependencies.
  6. Package installs: update and install in one RUN, without recommended extras, with package lists removed in the same layer; lockfile-respecting install commands.
  7. .dockerignore: excludes .git, local env files, build output and dependency folders.
  8. Runtime: exec-form ENTRYPOINT/CMD so the process receives signals; a process that handles SIGTERM, or an init when it spawns children; HEALTHCHECK only when the platform uses it; WORKDIR set; no ADD from URLs and no download-and-run commands.
constraints
  • Every finding cites a line and says what goes wrong in practice (attack, failure or cost), not only which rule it breaks.
  • Do not quote image size or build time savings as facts. Mark them as estimates unless you built the image.
  • Keep the app's behaviour the same in the revised file. If a fix needs information you do not have (the app's port, its writable paths), say so instead of guessing.
  • Skip style-only remarks such as instruction casing or comment wording.
  • Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
  • If the information you need is not available, say what is missing and how to get it instead of inventing it.
output format

Verdict

One line: ship, ship-after-fixes or rework, with the number of findings by severity.

Findings

Numbered, most severe first: [high|medium|low] line N — problem — impact — fix.

Revised Dockerfile

The full corrected file, with a short comment on each changed line. Omit this section if there are no findings above low.

Not checked

What you could not verify (base image vulnerabilities, actual image size, the app's signal handling). "None" if empty.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
DevOps
level
Intermediate
made for
DevOps / platform engineer, Software engineer, Site reliability engineer
needs
repo-read
risk
read-only
version
v1.0.0 · experimental
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install review-dockerfile --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill review-dockerfile -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

more in devops

All of DevOps
PromptDevOps

Design a deployment strategy

Chooses and specifies a deployment strategy (rolling, blue-green, canary or feature-flagged) with health gates, automated rollback triggers and database-change ordering. Use when deploys feel risky.

design-deployment-strategy
PromptDevOps

Review an infrastructure plan before apply

Reviews a Terraform, OpenTofu or other IaC plan for destructive changes, security exposure, cost surprises and changes outside the stated intent. Use before running apply, especially in production.

review-iac-plan
PromptDevOps

Write a Docker Compose dev environment

Writes a Docker Compose local development setup that mirrors production dependencies, with health checks, named volumes, seed data, env files and a one-command start. Use when onboarding developers.

write-docker-compose
PromptDevOps

Write a GitHub Actions workflow

Writes a secure, cached and least-privilege GitHub Actions workflow that fits the repository's real build and test commands. Use when adding CI, a release job or a scheduled task.

write-github-actions-workflow
PersonaDevOps

DevOps engineer

Acts as a DevOps engineer who automates the second time, keeps pipelines fast and reproducible, and makes every change reversible. Use for CI/CD, infrastructure and release work.

devops-engineer
PromptDevOps

Plan backups and disaster recovery

Writes a backup and disaster-recovery plan with RPO and RTO targets, dependency order, restore drills and owner checklists. Use when a system has backups nobody has restored, or no plan at all.

plan-disaster-recovery