docker-patterns
Skill8 starsChanged 10 months agoMITView on GitHub
Docker best practices, multi-stage builds, container security, Docker Compose orchestration, and deployment patterns. Use when containerizing applications, optimizing Docker images, setting up development environments, or deploying with Docker.
- Reads credentials
- Deletes or force-pushes
- Installs packages
32 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- ku5ic/claude-kittheir own version, first seen Oct 6, 2026
- Lukk17/agent-standardstheir own version, first seen Oct 5, 2026
- imMamdouhaboammar/tiktok-growth-automation-meshtheir own version, first seen Oct 1, 2026
- productionx-in/Core-Skillstheir own version, first seen Sep 29, 2026
- lintangknitto/agent-skillstheir own version, first seen Sep 23, 2026
- ZeroTokenClaw/agents-skillstheir own version, first seen Sep 21, 2026
Used with
Projects with it also use content-hash-cache-pattern, carrier-relationship-management and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
InfopibeSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 10 projects that use this
InfopibeSkillcarrier-relationship-management
Codified expertise for managing carrier portfolios, negotiating freight rates, tracking carrier performance, allocating freight, and maintaining strategic carrier relationships. Informed by transportation managers with 15+ years experience. Includes scorecarding frameworks, RFP processes, market intelligence, and compliance vetting. Use when managing carriers, negotiating rates, evaluating carrier performance, or building freight strategies.
Also in 8 projects that use this
mryeastcodeSkillpytorch-patterns
PyTorch deep learning patterns and best practices for building robust, efficient, and reproducible training pipelines, model architectures, and data loading.
Also in 7 projects that use this
saxon-ySkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 9 projects that use this
tpavanipradeepSkillai-regression-testing
Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code.
Also in 8 projects that use this
- +7 more from Infopibe
Other versions32 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- langchain-ai/skills-benchmarks★ 11813% same
Wrote their own version · 31
- xu-xiang/everything-claude-code-zh★ 2ksame name
- loulanyue/awesome-claude-notes★ 272same name
- tpavanipradeep/everything-claude-code★ 134same name
- templetongroup/radiant★ 113same name
- Jamkris/everything-gemini-code★ 87same name
- tranhieutt/software_development_department★ 72same name
- sabahattink/antigravity-fullstack-hq★ 30same name
- skateddu/claude-code-python-setup★ 28same name
- woxiangyangzhimao/skills★ 14same name
- noah-sheldon/ai-dev-kit★ 13same name
21 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-rest-designSkill
- brandkitSkill
- industrial-brutalist-uiSkill
- bug-fixingSkill
- ci-cd-pipelinesSkill
- code-documentationSkill
- context7Skill
- design-an-interfaceSkill
- feature-developmentSkill
- frontend-designSkill
- git-commitSkill
- git-releaseSkill
- git-team-workflowSkill
- go-conventionsSkill
- gpt-tasteSkill
- imagegen-frontend-mobileSkill
- imagegen-frontend-webSkill
- image-to-codeSkill
- issue-writingSkill
- kubernetes-patternsSkill
- microservices-patternsSkill
- minimalist-uiSkill
- mongodb-patternsSkill
- observability-monitoringSkill
- full-output-enforcementSkill
- performance-optimizationSkill
- postgresql-patternsSkill
- prdSkill
- pr-writingSkill
- python-patternsSkill
- redesign-existing-projectsSkill
- refactoring-safelySkill
- rust-patternsSkill
- security-best-practicesSkill
- skill-creatorSkill
- high-end-visual-designSkill
- spec-driven-developmentSkill
- sqlserver-patternsSkill
- stitch-design-tasteSkill
- task-managementSkill
- design-taste-frontendSkill
- testing-strategiesSkill
- ts-react-nextjsSkill
- ts-vue-svelteSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 63
Don't include build tools in production
- Distinctive: line 66
Run as non-root user
- Very specific: line 67
Use specific image tags (not latest)
- Very specific: line 74
Use .dockerignore to exclude unnecessary files
- Distinctive: line 154
Use this skill when:
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Docker Patterns Skill
Overview
This skill provides guidelines for building production-ready Docker containers, multi-stage builds, security hardening, Docker Compose orchestration, and deployment best practices.
Quick Reference
Multi-Stage Build Example
# Build stage
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Production stage
FROM node:18-alpine
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
WORKDIR /app
COPY --from=builder --chown=nodejs:nodejs /app/dist ./dist
COPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules
USER nodejs
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
CMD ["node", "dist/main.js"]Docker Compose Development
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
volumes:
- .:/app
- /app/node_modules
environment:
- NODE_ENV=developmentCore Principles
1. Multi-Stage Builds
- Separate build and runtime environments
- Minimize final image size
- Don't include build tools in production
2. Security Hardening
- Run as non-root user
- Use specific image tags (not
latest) - Scan images for vulnerabilities
- Drop unnecessary capabilities
3. Layer Caching
- Order instructions by change frequency
- Copy package files before source code
- Use
.dockerignoreto exclude unnecessary files
4. Health Checks
- Implement
/healthendpoints - Configure Docker health checks
- Set appropriate intervals and timeouts
Language-Specific Examples
See detailed guides in references/:
- Dockerfile Patterns - Multi-stage builds for Node.js, Python, Go, Rust
- Docker Compose Patterns - Development, production, and multi-environment setups
- Container Security - Security hardening, scanning, and best practices
- Deployment Patterns - Blue-green, rolling updates, Kubernetes
Dockerfile Best Practices
# ✅ DO: Use specific tags
FROM node:18.19.0-alpine3.18
# ✅ DO: Combine RUN commands
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*
# ✅ DO: Create non-root user
RUN addgroup -g 1001 -S appgroup && \
adduser -S appuser -u 1001 -G appgroup
USER appuser
# ✅ DO: Copy with ownership
COPY --chown=appuser:appgroup . /app
# ✅ DO: Add health check
HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
CMD wget --quiet --tries=1 --spider http://localhost:3000/health || exit 1Docker Compose Best Practices
# ✅ DO: Use environment files
services:
app:
env_file:
- .env.production
# ✅ DO: Set resource limits
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
# ✅ DO: Configure health checks
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3Image Scanning
# Using Trivy
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
aquasec/trivy:latest image myapp:latest
# Using Docker Scout
docker scout cves myapp:latest
# Using Snyk
snyk container test myapp:latestWhen to Use This Skill
Use this skill when:
- Creating Dockerfiles for production applications
- Setting up development environments with Docker Compose
- Optimizing image sizes with multi-stage builds
- Hardening containers for security
- Setting up health checks and monitoring
- Managing multiple environments (dev/staging/prod)
- Implementing CI/CD pipelines with Docker
- Troubleshooting container issues
Related Skills
@ci-cd-pipelines- Continuous integration and deployment with GitHub Actions@security-best-practices- Container security and vulnerability scanning@feature-development- Development workflow@python-patterns- Python-specific patterns@go-conventions- Go-specific patterns@ts-react-nextjs- Node.js patterns
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

