dockerfile-best-practices
Installation
SKILL.md
Dockerfile Best Practices
Writing efficient, secure container images.
Context
You are writing a Dockerfile. Optimize for size, build speed, and security.
Domain Context
- Layers: Each line creates a layer; fat layers are slow to build/push
- Caching: Earlier layers cache better; put changeable stuff at end
- Multi-Stage: Separate build and runtime images; smaller final image
- Security: Don't run as root; minimal base image
- Size: Alpine < Ubuntu < Debian; watch for bloat