docker

Installation
SKILL.md

Docker & Containerization Skill

Roadmap Alignment: roadmap.sh/docker Reference: Docker Documentation

Core Standards (Effective Software Developer)

When writing or reviewing Dockerfiles and docker-compose.yml configurations, ensure they adhere to modern containerization best practices.

1. Dockerfile Best Practices

  • Base Images: Always use official, minimal base images (e.g., alpine, slim, or distroless) to reduce attack surface and download size. Pin specific versions (e.g., node:18-alpine instead of node:latest).
  • Multi-Stage Builds: Use multi-stage builds to separate build dependencies from runtime execution. Never ship source code, compilers, or test dependencies in a production image.
  • Layer Caching: Order commands from least likely to change to most likely to change. Copy dependency files (like package.json or Gemfile) and install dependencies before copying the rest of the source code.
  • Non-Root User: Never run containers as the root user in production. Always create a dedicated user and switch to it using the USER instruction.
  • Environment Variables: Use ENV to set defaults, but prefer passing secrets at runtime. Avoid hardcoding credentials in the Dockerfile.
  • Graceful Shutdown: Handle SIGTERM properly. Use CMD ["executable", "param1"] (exec form) rather than CMD command param1 (shell form) so the process receives signals correctly.
Installs
1
First Seen
May 20, 2026
docker — jcchikikomori/skills-md