/ci-incident-medic:dockerfile-optimize Dockerfilefrom ci-incident-medic
Analyze and harden a Dockerfile for size, security, and build speed
Ships in ci-incident-medic. Installing the plugin adds it to Claude Code.
Analyze a Dockerfile and harden it: smaller image, non-root runtime, faster cache-friendly builds. Use this before an image ships or when builds are slow, huge, or flagged by a scanner. $ARGUMENTS is the Dockerfile path; default to ./Dockerfile if omitted.
FROM and the copied manifests (package.json, requirements.txt/pyproject.toml, go.mod, pom.xml/build.gradle, Cargo.toml)..dockerignore exists alongside it.Apply the dockerfile-smells skill. Flag each present:
| Smell | Cost |
|---|---|
Runs as root (no USER) | container escape blast radius, violates most policies |
latest or unpinned base tag | non-reproducible builds, silent base drift |
| No multi-stage build | build toolchain + source shipped in final image |
| Cache-busting layer order | COPY . . before dependency install invalidates cache every edit |
| Secrets baked into layers | tokens/keys recoverable from image history forever |
apt-get/apk without cleanup | lists and caches bloat the layer |
Missing .dockerignore | huge build context, secrets/.git sent to daemon |
No HEALTHCHECK | orchestrator can't detect a wedged-but-running process |
USER, optimal layer ordering, no secrets in layers, minimal packages, and a HEALTHCHECK where it makes sense. The agent also emits a matching .dockerignore.multistage-patterns.md reference for the ecosystem-specific template.Produce these sections:
.dockerignore: the file contents.docker images measurement.docker buildx imagetools inspect <image:tag> if it is unknown.What the command file sets; muted values are Claude Code's defaults
inherit7-day visitors to each command page
npx claudepluginhub sigistry/marketplace --plugin ci-incident-medic5 commands in this plugin
/gha-triageProcessTriage a failing GitHub Actions run and produce the exact corrected YAML/k8s-preflightProcessValidate Kubernetes manifests before deploy with a gated PASS/WARN/FAIL checklist/postmortemProcessDraft a blameless postmortem from incident evidence/workflow-reviewProcessProactively review a GitHub Actions workflow for security and speed