Dockerfile review with fixes

Flags latest tags, running as root, apt without cleanup, COPY . before dependency installs, secrets in ENV/ARG and missing HEALTHCHECK, with line numbers, reasons and fixes.

ClaudeHermes AgentCodexCursorMIT (modify, redistribute and use commercially)Python

What it does

Statically checks a Dockerfile for security, image size, reproducibility and cache problems, with line numbers.

  • FROM without a tag or with :latest (digest pins and ARG defaults are taken into account)
  • Final stage running as root (no USER, or last USER is root)
  • apt-get without cleanup, update and install in separate RUNs, missing -y or --no-install-recommends, apk add without --no-cache, pip cache left in the layer
  • COPY . . before installing dependencies, which defeats layer caching
  • Secret-looking names in ENV/ARG, inline credentials in RUN, COPY of .env or key files
  • Missing HEALTHCHECK, duplicate or shell-form CMD/ENTRYPOINT, ADD from URLs, piping curl into sh, sudo, chmod 777, EXPOSE 22, relative WORKDIR, missing .dockerignore and more
  • Handles multi-stage builds, line continuations, # escape= and RUN <<EOF heredocs

How to use

python scripts/dockerfile_lint.py Dockerfile --json dockerfile-review.json

The agent confirms each finding in context (does the base image already set a non-root user, is it deployed on Kubernetes, and so on) and proposes a corrected Dockerfile or diff.

Requirements

  • Python 3 (standard library only). Docker itself is not required.

Caveats

  • Static checks only: no image pulls or builds, so the base image contents are not inspected.
  • Heuristic rules can misfire on unusual syntax.
  • If an already pushed image contained a secret, fixing the Dockerfile is not enough: rotate the secret.

How to install

  1. Unzip the downloaded file (it contains a dockerfile-review/ folder with SKILL.md).
  2. Copy the whole folder into your agent's skills folder.
    • Claude: ~/.claude/skills/ (per project: .claude/skills/)
    • Hermes Agent: ~/.hermes/skills/
    • Codex: ~/.agents/skills/ / Cursor: ~/.cursor/skills/
    • Claude app (claude.ai): upload the ZIP in Customize → Skills
  3. Restart the agent and check that the skill appears in its skill list.

Step-by-step install for Windows / Mac and each agent

Seller

AI Skill Market (official)

44 published skills

Seller profile and all skills