docker · mindrally — Claude Code skill: what it does, how to install
Establishes best practices for lean Docker images, multi-stage builds, container security, and Compose workflows.
npx skills add Mindrally/skills --skill docker -a claude-codeWhat docker does
This skill guides coding agents on writing lean, isolated container setups. It enforces one process per container alongside official base images pinned to specific version tags. Floating tags like latest are out. To cut image footprints, the instructions demand multi-stage builds and cleaning package manager caches within the same RUN instruction.
Security guidelines require running containers under a non-root user. Resource limits for CPU and memory must be set. Baking secrets into images is strictly forbidden. For sensitive variables, the skill directs agents toward dedicated secrets management tools instead of environment variables.
For multi-container projects, the rules configure Docker Compose version 3+ setups with explicit networks and health-check dependencies. In continuous integration pipelines, images receive git commit SHA tags and undergo vulnerability scanning prior to registry deployment.
What it helps with
- build minimal multi-stage Dockerfiles with separate build and runtime phases
- configure Docker Compose version 3+ files with explicit networks and volume mounts
- secure container execution with non-root users and read-only file systems
- enforce health checks alongside CPU and memory limits
- integrate automated image scanning and git SHA tagging into CI/CD pipelines
Example prompts for the agent
- Write a multi-stage Dockerfile for a Python API running as non-root
- Create a Docker Compose v3 configuration with explicit bridge networks and health checks
- Audit my Dockerfile layers and generate an optimized .dockerignore file
How to install docker
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill docker -a claude-code2Manually: put the files in place
~/.claude/skills/docker/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/docker/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill docker -a codex2Manually: put the files in place
.agents/skills/docker/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill docker -a cursor2Manually: put the files in place
.cursor/skills/docker/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills docker2Manually: put the files in place
.github/skills/docker/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill docker -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path dockerManually: put the files in place
.devin/skills/docker/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill docker -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about docker
How to install docker in Claude Code?
Run npx skills add Mindrally/skills --skill docker -a claude-code or place the file directly at ~/.claude/skills/docker/SKILL.md.
What does the docker skill do?
It provides containerization guidelines covering multi-stage builds, non-root user security, layer cache optimization, and Docker Compose version 3+ workflows.
How does this skill handle credentials and sensitive data?
The instructions forbid embedding secrets in image layers or storing them in plain environment variables, requiring a secrets manager instead.
Source text
SKILL.md · Apache-2.0
--- name: docker description: Docker containerization best practices for building, securing, and deploying containers. metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Docker Development You are an expert in Docker containerization, image building, and container orchestration. ## Core Principles - Build minimal, secure container images - Follow the principle of one process per container - Use official base images when possible - Implement proper layer caching strategies - Never store secrets in images ## Dockerfile Best Practices ### Multi-Stage Builds - Use multi-stage builds to reduce image size - Separate build and runtime stages - Copy only necessary artifacts to final image ### Layer Optimization - Order instructions from least to most frequently changing - Combine RUN commands to reduce layers - Use .dockerignore to exclude unnecessary files - Clean up package manager caches in same layer ### Base Images - Use specific version tags, not `latest` - Prefer slim or alpine variants for smaller size - Scan base images for vulnerabilities - Consider distroless images for production ## Security Best Practices - Run containers as non-root user - Use read-only file systems where possible - Implement health checks - Scan images for vulnerabilities regularly - Use secrets management, not environment variables for sensitive data - Implement resource limits (CPU, memory) ## Docker Compose ### Configuration - Use version 3+ compose files - Define networks explicitly - Use volumes for persistent data - Implement depends_on with health checks - Use environment files for configuration ### Development Workflow - Mount source code for hot reloading - Use override files for environment-specific config - Implement proper logging drivers - Use build args for build-time variables ## CI/CD Integration - Build images in CI pipelines - Tag images with git commit SHA - Push to secure container registries - Implement automated vulnerability scanning - Use image signing for verification ## Networking - Use user-defined bridge networks - Implement service discovery via DNS - Expose only necessary ports - Use network aliases for service communication ## Logging and Monitoring - Use appropriate logging drivers - Implement structured logging - Forward logs to centralized system - Monitor container metrics - Implement proper health checks
© Mindrally · Apache-2.0 · Mindrally/skills
Similar skills
All skills for DevOps and infrastructure →docker by other authors comes first.