dockerfile-best-practices
Installation
SKILL.md
Dockerfile Best Practices Skill
This skill produces production-grade Dockerfiles following modern security, efficiency, and maintainability best practices. The four pillars are:
- Multi-stage builds — separate build and runtime environments
- No secrets in layers — zero credentials baked into images
- Proper base image selection — right image for build vs runtime
- Minimal, hardened runtime — least-privilege, small attack surface
Before writing any Dockerfile, read the user's stack (language, framework, entrypoint) and apply the matching pattern from this skill. When reviewing an existing Dockerfile, check all four pillars and report findings before rewriting.
Step 1 — Identify the Stack
Ask (or infer from context) the following before writing: