Comprehensive Docker best practices for images, containers, and production deployments
View on GitHubJosiahSiegel/claude-plugin-marketplace
docker-master
plugins/docker-master/skills/docker-best-practices/SKILL.md
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/JosiahSiegel/claude-plugin-marketplace/blob/main/plugins/docker-master/skills/docker-best-practices/SKILL.md -a claude-code --skill docker-best-practicesInstallation paths:
.claude/skills/docker-best-practices/## ๐จ CRITICAL GUIDELINES ### Windows File Path Requirements **MANDATORY: Always Use Backslashes on Windows for File Paths** When using Edit or Write tools on Windows, you MUST use backslashes (`\`) in file paths, NOT forward slashes (`/`). **Examples:** - โ WRONG: `D:/repos/project/file.tsx` - โ CORRECT: `D:\repos\project\file.tsx` This applies to: - Edit tool file_path parameter - Write tool file_path parameter - All file operations on Windows systems ### Documentation Guidelines **NEVER create new documentation files unless explicitly requested by the user.** - **Priority**: Update existing README.md files rather than creating new documentation - **Repository cleanliness**: Keep repository root clean - only README.md unless user requests otherwise - **Style**: Documentation should be concise, direct, and professional - avoid AI-generated tone - **User preference**: Only create additional .md files when user specifically asks for documentation --- # Docker Best Practices This skill provides current Docker best practices across all aspects of container development, deployment, and operation. ## Image Best Practices ### Base Image Selection **2025 Recommended Hierarchy:** 1. **Wolfi/Chainguard** (`cgr.dev/chainguard/*`) - Zero-CVE goal, SBOM included 2. **Alpine** (`alpine:3.19`) - ~7MB, minimal attack surface 3. **Distroless** (`gcr.io/distroless/*`) - ~2MB, no shell 4. **Slim variants** (`node:20-slim`) - ~70MB, balanced **Key rules:** - Always specify exact version tags: `node:20.11.0-alpine3.19` - Never use `latest` (unpredictable, breaks reproducibility) - Use official images from trusted registries - Match base image to actual needs ### Dockerfile Structure **Optimal layer ordering** (least to most frequently changing): ```dockerfile 1. Base image and system dependencies 2. Application dependencies (package.json, requirements.txt, etc.) 3. Application code 4. Configuration and metadata ``` **Rationale:** Docker caches layers. If code change