dockerfile-best-practices

Installation
SKILL.md

Dockerfile Best Practices

Apply these rules when writing, reviewing, or optimizing any Dockerfile.

Base Images

  • Use minimal base images: alpine, slim, distroless, or scratch
  • Compiled languages (Go, Rust): use scratch images
  • Interpreted languages (Node.js, Python): use alpine or slim (runtime needed)
  • Always use multistage builds to separate build-time and runtime dependencies

Image Optimization

Layer Caching

Order layers from least-changing to most-changing:

Installs
2
First Seen
Feb 24, 2026
dockerfile-best-practices — sarpit/agent-skills