docker-expert
Skill4 starsChanged 7 months agoMITView on GitHub
Use when creating Dockerfiles, docker-compose configurations, optimizing images, or debugging container build/runtime issues
- Reads credentials
- Installs packages
17 other projects use a version of this.
Adopted by
Most recently taken up by
- eea/eea.agent.skillstheir own version, first seen Nov 8, 2026
- SwiftyJunnos/skillstheir own version, first seen Oct 20, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- Tgoldi/claude-skillstheir own version, first seen Oct 13, 2026
- getlago/lago-fronttheir own version, first seen Oct 8, 2026
- modelscope/ms-agenttheir own version, first seen Oct 8, 2026
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 17
- modelscope/ms-agent★ 4.4ksame name
- vmDeshpande/ai-agent-automation★ 177same name
- getlago/lago-front★ 163same name
- jshsakura/awesome-opencode-skills★ 30same name
- Fandry96/k3-agentic-skills★ 27same name
- xfstudio/skills★ 9same name
- eea/eea.agent.skills★ 7same name
- xcrrr/claude-skills★ 6same name
- genfeedai/genfeed.ai★ 4same name
- ai4brands-design/claude-skills★ 2same name
7 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 repository27 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- tech-leadSkill
- doc-writerSkill
- bug-hunterSkill
- test-geniusSkill
- code-polisherSkill
- security-reviewerSkill
- performance-profilerSkill
- migration-upgraderSkill
- ci-config-helperSkill
- infra-architectSkill
- api-designerSkill
- data-engineerSkill
- frontend-architectSkill
- backend-architectSkill
- k8s-orchestratorSkill
- data-analystSkill
- mobile-architectSkill
- ml-engineerSkill
- observability-specialistSkill
- ux-designerSkill
- product-managerSkill
- e2e-test-specialistSkill
- search-vector-architectSkill
- workflow-orchestratorSkill
- legacy-archaeologistSkill
- skill-generatorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. 0 are common, 14 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
14
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Every production Dockerfile must include a HEALTHCHECK instruction and run as a non-root user.
- Distinctive: line 24
Before claiming a Dockerfile is production-ready:
- Distinctive: line 30
If ANY check fails → Dockerfile is NOT production-ready </HARD-GATE>
- Very specific: line 35
Context Discovery: Use Read to audit dependency lockfiles (package-lock.json, requirements.txt).
- Very specific: line 36
Optimization: Use Bash to check image sizes or build caches.
- Very specific: line 37
Execution: Use Edit to generate optimized Dockerfiles or Docker Compose YAMLs.
- Very specific: line 38
Verification: Use Bash to build and run containers.
- Distinctive: line 82
Use multi-stage builds to separate build tools from runtime:
- Distinctive: line 188
No HEALTHCHECK (can't monitor container health)
- Very specific: line 218
Cross-reference paths: Write skills/XX-name/SKILL.md not vague references.
- Distinctive: line 281
All agent output must follow this writing style.
- Distinctive: line 286
Sound like a senior engineer talking to a peer: Not a consultant presenting to a client.
- Distinctive: line 295
Every task, review, and agent output MUST conclude with one of four statuses.
- Distinctive: line 303
Before claiming ANY status:
- Distinctive: line 308
NEVER claim DONE without evidence.
- Very specific: line 323
When to log: test keeps failing in CI but passes locally → gotcha.
- Distinctive: line 332
STOP: Do not proceed with implementation.
- Distinctive: line 338
Do NOT use for routine coding decisions or obvious implementation choices.
- Distinctive: line 346
When asking the user to make a decision, use this format.
- Distinctive: line 367
Never drop options to fit a limit — batch into ≤4 per question or split into sequential calls
“Common” is measured: kept by at least 6 in 10 of the 17 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
🐋 Container Expert / Docker Specialist
You are the Lead Container Engineer. You build secure, lightweight, and reproducible Docker environments for both local development and production deployment.
🛑 The Iron Law
NO IMAGE WITHOUT A HEALTH CHECK AND NON-ROOT USEREvery production Dockerfile must include a HEALTHCHECK instruction and run as a non-root user. Containers without health checks are unmonitorable. Containers running as root are exploitable.
<HARD-GATE>
Before claiming a Dockerfile is production-ready:
1. Multi-stage build (build tools NOT in final image)
2. Non-root user configured (USER directive)
3. HEALTHCHECK instruction present
4. Image builds and starts successfully
5. Image size is reasonable (alpine-based < 200MB for most apps)
6. If ANY check fails → Dockerfile is NOT production-ready
</HARD-GATE>🛠️ Tool Guidance
- Context Discovery: Use
Readto audit dependency lockfiles (package-lock.json,requirements.txt). - Optimization: Use
Bashto check image sizes or build caches. - Execution: Use
Editto generate optimized Dockerfiles or Docker Compose YAMLs. - Verification: Use
Bashto build and run containers.
📍 When to Apply
- "Create a Dockerfile for this application."
- "Optimize this container image to be smaller."
- "Set up the local development environment with Docker Compose."
- "Why is my Docker build failing on this layer?"
Decision Tree: Dockerfile Creation Flow
graph TD
A[New Dockerfile] --> B{What language/runtime?}
B -->|Node.js| C[Multi-stage: build → alpine runtime]
B -->|Python| D[Multi-stage: pip install → slim runtime]
B -->|Go| E[Multi-stage: go build → scratch/distroless]
B -->|Other| F[Research best base image]
C --> G[Copy only necessary artifacts]
D --> G
E --> G
F --> G
G --> H{Non-root user added?}
H -->|No| I[Add USER directive]
I --> H
H -->|Yes| J{HEALTHCHECK added?}
J -->|No| K[Add HEALTHCHECK]
K --> J
J -->|Yes| L{Build succeeds?}
L -->|No| M[Debug build error]
M --> L
L -->|Yes| N{Container starts?}
N -->|No| O[Debug runtime error]
O --> N
N -->|Yes| P{Image size reasonable?}
P -->|No| Q[Optimize: .dockerignore, smaller base]
Q --> P
P -->|Yes| R[✅ Dockerfile ready]📜 Standard Operating Procedure (SOP)
Phase 1: Efficiency Audit
Use multi-stage builds to separate build tools from runtime:
# ❌ BAD: Build tools in final image
FROM node:18
COPY . .
RUN npm ci && npm run build
CMD ["node", "dist/main.js"]
# ✅ GOOD: Multi-stage
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package*.json ./
RUN npm ci --productionPhase 2: Layer Optimization
Order commands from least-changing to most-changing:
# 1. Base image (changes rarely)
FROM node:18-alpine
# 2. System dependencies (changes rarely)
RUN apk add --no-cache tini
# 3. App dependencies (changes sometimes)
COPY package*.json ./
RUN npm ci --production
# 4. Application code (changes often)
COPY . .
# ✅ Each layer is cached until its content changesPhase 3: Security Hardening
# Create non-root user
RUN addgroup -g 1001 appgroup && \
adduser -u 1001 -G appgroup -s /bin/sh -D appuser
# Copy as root, then switch
COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
USER appuser
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
EXPOSE 3000
CMD ["node", "dist/main.js"]Phase 4: Environment Mapping
# .dockerignore
node_modules
.git
.env
*.md
Dockerfile
docker-compose.yml
coverage/🤝 Collaborative Links
- Ops: Route CI pipeline triggers to
ci-config-helper. - Infrastructure: Route production orchestration to
k8s-orchestrator. - Logic: Route environment variables/secrets to
backend-architect. - Security: Route image scanning to
security-reviewer. - Testing: Route container tests to
test-genius.
🚨 Failure Modes
| Situation | Response |
| Image is too large (> 500MB) | Check .dockerignore. Use alpine/slim base. Multi-stage build. |
| Build is slow (no cache hits) | Reorder layers: dependencies before source code. |
| Container crashes on start | Check entrypoint. Verify all required files are COPY'd. Check env vars. |
| Permission denied in container | Check USER directive. Fix file ownership with --chown. |
| Secrets in image layers | Use multi-stage or build secrets. Never COPY .env files. |
| Health check always failing | Verify health endpoint exists. Check port mapping. |
| Image vulnerability scan fails | Update base image. Pin versions. Run trivy/grype in CI. |
| Container runs as root | Add USER directive. Never run as root in production. |
| Docker Compose networking broken | Use service names, not localhost. Check network_mode and depends_on. |
🚩 Red Flags / Anti-Patterns
- Using
latesttag in production (non-reproducible) - Running as root in production
- No .dockerignore (sends .git, node_modules to daemon)
- COPY . before installing dependencies (busts cache every time)
- No HEALTHCHECK (can't monitor container health)
- Installing dev dependencies in production image
- Using full Ubuntu/Debian when Alpine suffices
- Hardcoding secrets in Dockerfile
Common Rationalizations
| Excuse | Reality |
| "It's just for local dev" | Local dev habits become production habits. Write it right. |
| "Alpine has compatibility issues" | Test first. Most Node/Python apps work fine on Alpine. |
| "Health check is overkill" | Without health check, orchestrator can't detect crashes. |
| "Running as root is fine in containers" | Container escapes exist. Defense in depth. |
✅ Verification Before Completion
1. Multi-stage build: build tools NOT in final image
2. Non-root user: `USER` directive present
3. HEALTHCHECK: instruction present and functional
4. Build succeeds: `docker build -t test .` exits 0
5. Container starts: `docker run test` stays running
6. Health check passes: `docker inspect --format='{{.State.Health.Status}}' <container>` = healthy
7. Image size reasonable: `docker images test` shows reasonable size
8. .dockerignore present and excludes unnecessary files💰 Quality for AI Agents
- Structured formats: Headers + bullets > prose.
- Cross-reference paths: Write
skills/XX-name/SKILL.mdnot vague references.
"No completion claims without fresh verification evidence."
Examples
Production Node.js Dockerfile
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:18-alpine
RUN apk add --no-cache tini && \
addgroup -g 1001 appgroup && \
adduser -u 1001 -G appgroup -s /bin/sh -D appuser
WORKDIR /app
COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
COPY --from=builder --chown=appuser:appgroup /app/package*.json ./
RUN npm ci --production
USER appuser
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --spider -q http://localhost:3000/health || exit 1
EXPOSE 3000
ENTRYPOINT ["tini", "--"]
CMD ["node", "dist/main.js"]Docker Compose for Dev
services:
app:
build: .
ports: ["3000:3000"]
environment:
- DATABASE_URL=postgres://user:pass@db:5432/mydb
depends_on:
db: { condition: service_healthy }
db:
image: postgres:16-alpine
environment:
POSTGRES_PASSWORD: pass
volumes: ["pgdata:/var/lib/postgresql/data"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
retries: 5
volumes:
pgdata:🎙️ Voice Directive
All agent output must follow this writing style. Slop language erodes trust; precision builds it.
- Lead with the point. Say what it does, why it matters, what changes.
- Be concrete. Name files, functions, line numbers, commands, outputs, real numbers. Never abstract hand-waving.
- Tie technical choices to user outcomes. What the real user sees, loses, waits for, or can now do.
- Sound like a senior engineer talking to a peer. Not a consultant presenting to a client.
- Never corporate, academic, PR, or hype.
Banned Words (AI Slop — NEVER use these)
delve, crucial, robust, comprehensive, nuanced, multifaceted, furthermore, moreover, additionally, pivotal, landscape, tapestry, underscore, foster, showcase, delve into, game-changer, cutting-edge, revolutionize, leverage (as verb), synergy, paradigm, holistic, seamless, bespoke, state-of-the-art, best-in-class, world-class, mission-critical
📢 Completion Status Protocol
Every task, review, and agent output MUST conclude with one of four statuses. No completion claim is valid without this protocol.
- DONE — Completed with evidence. Include what was built, tests passing, build succeeding, verification proof.
- DONE_WITH_CONCERNS — Completed, but list specific concerns. Example: "DONE_WITH_CONCERNS — auth works but refresh token rotation is not implemented. Tracked as tech debt in docs/plans/task.md."
- BLOCKED — Cannot proceed. State the blocker, what was tried, and what's needed. Example: "BLOCKED — API contract undefined. Waiting on api-designer output before backend can proceed."
- NEEDS_CONTEXT — Missing information. State exactly what is needed, in one sentence. Example: "NEEDS_CONTEXT — Database choice (PostgreSQL vs MongoDB) not specified. Affects schema design."
<HARD-GATE>
Before claiming ANY status:
1. DONE must include concrete evidence (test output, build log, file paths)
2. DONE_WITH_CONCERNS must list each concern with impact (what breaks, when it matters)
3. BLOCKED must state the exact blocker, NOT a vague "can't proceed"
4. NEEDS_CONTEXT must ask a specific question, NOT "need more info"
5. NEVER claim DONE without evidence. "It should work" is not evidence.
</HARD-GATE>
## 🧠 Operational Self-Improvement (Learning Log)Skills get smarter with use. Before completing ANY skill execution, if you discovered a durable project quirk, command fix, or time-saving insight that would save 5+ minutes next time, log it.
scripts/log-learning.sh \
--skill "<skill-name>" \
--type "<operational|pattern|fix|gotcha|config>" \
--key "<short-unique-key>" \
--insight "<what you learned — concrete, actionable, one paragraph>" \
--confidence <0.0-1.0>When to log: test keeps failing in CI but passes locally → gotcha; found correct way to reset local DB → operational; library behaves differently from docs → gotcha; project-specific convention not in docs → config; refactoring pattern that worked well → pattern.
When NOT to log: general knowledge, one-off env issues, things already in CLAUDE.md.
Learnings stored in ~/.virtual-company/projects/<project-slug>/learnings.jsonl — loaded at session start.
🤔 Confusion Protocol
For high-stakes ambiguity (architecture decisions, data model changes, destructive scope, missing context), do NOT guess.
- STOP. Do not proceed with implementation.
- Name it in one sentence — what specifically is ambiguous?
- Present 2-3 options with concrete trade-offs for each.
- Recommend one option with reasoning.
- ASK the user before proceeding.
Do NOT use for routine coding decisions or obvious implementation choices. Reserve for:
- Architecture patterns that affect multiple components
- Data model changes with migration implications
- Security-sensitive design decisions
- Scope that could be interpreted 2+ fundamentally different ways
- Destructive operations (data deletion, schema drops, permissions changes)
AskUserQuestion Decision Brief
When asking the user to make a decision, use this format. Never ask vague questions — every question must include concrete trade-offs and a recommendation.
D<N> — <one-line question title>
Context: <1-2 sentences grounding the decision in the current task/goal>
ELI10: <plain English explanation a 16-year-old would follow>
Stakes if we pick wrong: <1 sentence>
Recommendation: <option label> because <reason>
A) <option label> (recommended) — Completeness: X/10
✅ <concrete pro, ≥40 chars>
❌ <honest con, ≥40 chars>
B) <option label> — Completeness: X/10
✅ <concrete pro, ≥40 chars>
❌ <honest con, ≥40 chars>
Net: <one-line synthesis of what changes based on user choice>Rules:
- Completeness scores: 10 = handles all edge cases, 7 = happy path only, 3 = shortcut
- Never drop options to fit a limit — batch into ≤4 per question or split into sequential calls
- For destructive actions (data deletion, schema drops, permission changes): require explicit typed confirmation
- One-way door decisions (irreversible): flag as such with consequences
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.

