| name | docker |
| description | Production-grade Docker configurations (Dockerfile, Compose, best practices) |
| argument-hint | <dockerization request> |
| level | 2 |
Docker Skill
Use this skill when user explicitly requests Docker configurations.
When to Use
- User says: "dockerize", "add docker", "create a Dockerfile", "docker-compose"
- User wants to containerize an application
- User asks about Docker best practices
Trigger: docker: prefix or explicit Docker request
What This Skill Provides
Based on Docker Official Best Practices.
Files to Create
| File | When |
|---|
Dockerfile | Application containerization |
.dockerignore | Exclude unnecessary files |
docker-compose.yml | Multi-container orchestration |
docker-compose.override.yml | Dev-specific overrides |
compose.yaml | Compose v2 format |
Common Deliverables
- Multi-stage Dockerfile with build/production stages
- .dockerignore to reduce image size
- docker-compose.yml with:
- Health checks
- Resource limits
- Named volumes
- Networks
- Secrets (for sensitive data)
- Security best practices:
- Non-root user
- Minimal base images
- No secrets in image
Steps
-
Analyze Requirements
- Language/runtime of the application
- Dependencies and ports
- Environment variables needed
- Persistent data requirements
- Health check endpoint available?
-
Create Dockerfile
- Choose appropriate base image
- Multi-stage build pattern
- Non-root user
- Healthcheck directive
- Labels for metadata
-
Create .dockerignore
- Dependencies (node_modules, etc.)
- Build outputs
- Git and IDE files
- Environment files
-
Create docker-compose.yml
- Service definitions
- Volume mounts
- Network configuration
- Resource limits
- Health checks
-
Verify
docker build succeeds
docker compose up works
- Health checks pass
- No security warnings
Examples
User: "dockerize this Node.js API"
Why good: Clear request with specific tech stack
User: "add Docker support for the frontend app"
Why good: Explicit Docker request
User: "fix the login bug"
Why bad: No Docker involved
User: "build me a web app" (without Docker mention)
Why bad: Docker not explicitly requested
Related Skills
| Skill | Use When |
|---|
@deploy-engineer | Full deployment with Docker |
@infra-planner | Infrastructure design |
@dep-auditor | Check for vulnerabilities |
Documentation
See skills/docker/DOCKERFILE.md for:
- Complete Dockerfile patterns
- Docker Compose best practices
- Security checklist
- Multi-stage build examples
- Commands reference