avibebuilder/claude-prime / .claude/starter-skills/docker
docker
UnverifiedALWAYS activate when the user's query involves Docker in any way — even if it also matches other skills. If the words docker, Dockerfile, docker-compose, compose.yml, container, or image appear in the query, this skill MUST be used. Covers: writing or editing Dockerfiles and compose files, adding services (postgres, redis, etc.) to compose, volume mounts and data persistence, docker build failures (layer caching, npm install issues), healthchecks and service startup ordering (depends_on), environment variables in containers, port mapping, container crashes and exit codes (OOM/137), non-root users, multi-stage builds, image optimization, .dockerignore, and deploying to container runtimes. Takes priority over general implementation or debugging skills when Docker infrastructure is the subject.
Docker
Project-specific containerization patterns for Dockerfile and Docker Compose.
Architecture Decisions
Image Building
- Minimal base images — Use slim/alpine variants; pin to digest for reproducibility.
- Multi-stage builds — Separate build dependencies from runtime.
- Layer optimization — Combine RUN commands; place frequently changed files last.
- COPY over ADD — ADD only for tar extraction or remote URLs.
Security
- Non-root users — Always use UID >10000; never run as root in production.
- No secrets in images — Use Docker secrets or runtime env injection.
- .dockerignore required — Exclude .git, .env, node_modules, build artifacts.
Runtime
- One process per container — Single responsibility principle.
- Healthchecks required — Define HEALTHCHECK in Dockerfile or Compose.
- Resource limits — Always set mem_limit and cpus in production.
Compose
- Network segmentation — Dedicated networks per service group.
- Named volumes — Never use anonymous volumes in production.
- depends_on with healthchecks — Use
condition: service_healthy. - Environment separation — Use override files for dev/staging/prod.
Gotchas
COPY . .beforeRUN npm installbusts the cache on EVERY code change. Copypackage*.jsonfirst, install, THEN copy source.- Alpine uses musl libc, not glibc. Python packages with C extensions (numpy, pandas, cryptography) may fail to install or need
apk addbuild dependencies. Consider-slimvariants if you hit this. ENTRYPOINT ["python", "app.py"](exec form) handles signals correctly.ENTRYPOINT python app.py(shell form) wraps in/bin/sh -cand PID 1 won't receive SIGTERM — containers take 10s to stop.- Docker layer cache is invalidated from the FIRST changed layer downward. A changed
COPYnear the top rebuilds everything below it. depends_onwithoutcondition: service_healthyonly waits for container START, not readiness. Your app will crash connecting to a database that's still initializing.host.docker.internalworks on Docker Desktop (Mac/Windows) but NOT on Linux. Use--network hostor explicit container networking on Linux.- Build args (
ARG) are NOT available afterFROMin multi-stage builds unless re-declared. Each stage starts fresh. docker compose upreuses existing containers. After changingDockerfile, you needdocker compose up --buildordocker compose buildfirst.- Volume mounts override the container's filesystem — if your
node_modulesare built inside the container but you mount.:/app, the host's (possibly empty)node_modulesshadows them. Use a named volume fornode_modules. EXPOSEis documentation only — it does NOT publish the port. You still need-p 8080:8080orports:in compose.- Docker's default bridge network does NOT provide DNS resolution between containers. Use a custom network or compose's default network.
References
| When you need... | Read |
|---|---|
| Dockerfile patterns, CMD vs ENTRYPOINT | dockerfile.md |
| Compose services, networks, volumes | compose.md |
| Security hardening | security.md |
| Production deployment | production.md |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 117k | Updated | Claude CodeCodex | Unverified | Install |