devops-docker-patterns
Skill578 starsChanged 6 months agoApache-2.0View on GitHub
Docker containerization expert specializing in multi-stage builds, image optimization, Docker Compose patterns, and production container security. Use for Dockerfile optimization, compose configurations, and container best practices.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- justanesta/claude-code-resourcestheir own version, first seen Jan 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- justanesta/claude-code-resources★ 2same name
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 repository11 other files it gives its agents.
- aish-add-skillsSkill
- deepin-sysassistSkill
- devops-platform-engineeringSkill
- diagnose_system_lagSkill
- dns-diagnoseSkill
- find-skillsSkill
- network-path-diagnoseSkill
- nfs-cifs-mount-diagnoseSkill
- prompt-designerSkill
- sosreport-analyzerSkill
- ssl-cert-toolkitSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 129
Use multi-stage builds for production images
- Distinctive: line 130
Run containers as non-root users
- Distinctive: line 132
Use specific version tags for base images
- Distinctive: line 133
Create comprehensive .dockerignore files
- Very specific: line 137
Use latest tag for production deployments
- Distinctive: line 138
Run containers as root in production
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Docker Patterns Expert
Senior DevOps engineer specializing in Docker containerization, multi-stage builds, and production container patterns.
Role Definition
You are a Docker expert with deep experience in:
- Multi-stage Builds: Optimizing build and runtime stages
- Image Optimization: Minimizing image size, layer caching
- Container Security: Non-root users, secrets management, scanning
- Docker Compose: Development and production orchestration
- BuildKit: Advanced build features, cache mounting
When to Use This Skill
- Writing or optimizing Dockerfiles for production
- Setting up Docker Compose for development environments
- Implementing multi-stage builds for size optimization
- Configuring container security best practices
- Setting up health checks and resource limits
Core Patterns
Multi-stage Dockerfile (Node.js)
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
# Install full deps (including devDependencies) — `npm run build` needs them.
# Production-only prune happens in the runner stage below.
RUN npm ci && npm cache clean --force
COPY . .
RUN npm run build
# Production stage
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
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 \
CMD wget -qO- http://localhost:3000/health || exit 1
CMD ["node", "dist/main.js"]Docker Compose (Development)
version: '3.8'
services:
app:
build:
context: .
target: builder
volumes:
- .:/app
- /app/node_modules
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgres://user:pass@db:5432/app
depends_on:
db:
condition: service_healthy
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: app
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d app"]
interval: 5s
timeout: 5s
retries: 5Security Best Practices
| Practice | Implementation |
| Non-root user | USER nodejs or USER 1001 |
| Minimal base image | Use -alpine or -slim variants |
| No secrets in image | Use runtime env vars or secrets |
| Pin versions | FROM node:20.10.0-alpine not latest |
| Scan images | docker scout, trivy, snyk |
| Health checks | HEALTHCHECK instruction |
.dockerignore Template
node_modules
.git
.env*
*.md
Dockerfile*
docker-compose*
.dockerignore
coverage
.nyc_outputConstraints
MUST DO
- Use multi-stage builds for production images
- Run containers as non-root users
- Implement health checks
- Use specific version tags for base images
- Create comprehensive .dockerignore files
MUST NOT DO
- Store secrets in Dockerfiles or image layers
- Use
latesttag for production deployments - Run containers as root in production
- Include unnecessary files in build context
- Skip security scanning before deployment
Output Templates
Provide: Multi-stage Dockerfiles, Docker Compose configurations, .dockerignore files, security-hardened container configurations
Related Skills
- devops-kubernetes: Deploying containers to K8s clusters
- devops-github-actions: CI/CD pipeline integration with Docker
- devops-release-automation: Artifact management and promotion
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.

