cosmix/loom/loom-docker
Claude Code and agent skill by cosmix/loom
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Docker and container expertise.
Install
npx vskill@latest install cosmix/loom/loom-dockerSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as cosmix/loom/loom-docker.
Docker
Overview
Production-grade containers: Dockerfiles, compose, multi-stage builds, layer/cache optimization, security hardening, registries, debugging. The Expert Practices section below is the highest-value part — it states the mechanism behind each rule, which is what separates correct-but-naive Dockerfiles from production ones. Read it before writing anything non-trivial.
Writing Dockerfiles
Base image: official images; -alpine/-slim/distroless/scratch for runtime; pin by tag AND digest (python:3.12-slim@sha256:..., see Currency), never latest; multi-stage to drop build toolchains.
Layer ordering (cache): least-changing first (base → system deps → dependency manifests → source). Copy dependency manifests and install BEFORE copying source so a code edit doesn't bust the dependency layer — this single ordering rule is the biggest cache win.
Layer hygiene:
- Keep
apt-get updateandapt-get installin the SAMERUN— in separate layers Docker reuses a stale cachedupdateindex when only the install list changes, silently installing outdated/vulnerable packages (docs call this "cache busting"). Details in Anti-Patterns. --no-install-recommends, clean caches in the same layer (rm -rf /var/lib/apt/lists/*)..dockerignoreto keep context small (excludes.git,node_modules, build artifacts) — bloated context slows builds and busts cache.
Runtime & security: non-root numeric USER uid:gid (see Gotchas); --read-only root fs where possible; secrets via RUN --mount=type=secret, never ENV/ARG/COPY (see below); HEALTHCHECK; exec-form CMD/ENTRYPOINT (shell form breaks signals — see Anti-Patterns).
Why `ARG`/`ENV` are unsafe for secrets:ARG(incl.--build-arg) andENVare recorded in image metadata, visible viadocker history --no-trunc,docker inspect, and provenance attestations to anyone who can pull;ENVis additionally readable at runtime via/proc/self/environ. Unsetting in a laterRUNdoes NOT scrub it — already committed in the earlier layer. UseRUN --mount=type=secret.ARG/ENVare safe only for non-sensitive values (versions, build flags).
Docker Compose
- Deps:
depends_onwithcondition:(service_healthy,service_completed_successfully) — baredepends_ononly orders start, doesn't wait for readiness. - Health:
healthcheckon every service other services wait on. - Restart:
unless-stopped/on-failurefor production. - Networking: named networks for isolation; databases/caches get no host port mapping; reference services by name (DNS); listen on
0.0.0.0not127.0.0.1. - Volumes: named volumes for data; bind mounts for dev code only.
- Config:
${VAR:-default}interpolation;secrets:(file-backed) with*_FILEenv convention, not plaintext env. - Limits:
deploy.resources.limitsfor prod.
Security Hardening
- Minimal base (distroless/alpine) shrinks attack surface.
- Drop all Linux capabilities, add back only what's needed; pair with
no-new-privileges(see Security). - Non-root, read-only root, no
--privileged. - Scan in CI (trivy, grype, Docker Scout); keep bases current; generate SBOM + provenance (see Security).
- Secrets: never in Dockerfile/
ENV/ARG; build-time--mount=type=secret; runtime via orchestrator secrets/vault.
Debugging
Tools: dive (layer bloat), hadolint (Dockerfile lint), trivy/grype/Docker Scout (CVEs), ctop (live resource monitor). For minimal/distroless images that lack a shell, debug via docker run --entrypoint, ephemeral debug containers (kubectl debug), or docker cp files out.
Common causes: permission-denied → volume ownership vs container UID; "name not found" → wrong network / used localhost instead of service name; missing shared libs → glibc-vs-musl (see Gotchas); container exits immediately → check docker logs, verify CMD/ENTRYPOINT executable and required env present.
Language Notes
| Lang | Key points | |
|---|---|---|
| Python | python:3.x-slim for glibc; pip install --no-cache-dir; wheel-cache in builder; uv for speed. | |
| Node | Copy package*.json first; npm ci (reproducible) not install; ship prod deps via npm ci --omit=dev or npm prune --omit=dev AFTER build (bundler/TS are devDeps — see Currency); node:alpine for size. | |
| Rust | cargo chef for dep caching; --release + strip; copy only the binary; scratch/distroless runtime; target musl for alpine/scratch. | |
| Go | golang:alpine builder; CGO_ENABLED=0 static binary; scratch/distroless runtime; copy only the binary + CA certs. |
Examples
Multi-stage Python (glibc, non-root, healthcheck)
Node with BuildKit cache mounts + prune
Rust (cargo chef → distroless)
Go (static binary → scratch)
Compose with secrets, healthcheck, limits
.dockerignore
Multi-arch build (buildx)
Expert Practices: Idioms, Anti-Patterns & Gotchas
High-signal guidance. Each item states the mechanism, not just the rule.
Anti-Patterns
Shell form silently breaks signals and drops CMD. CMD gunicorn ... is wrapped as /bin/sh -c '<string>', so /bin/sh becomes PID 1 and (docs) "does not pass signals" — your app never gets SIGTERM from docker stop, which waits the full timeout then SIGKILLs (no graceful shutdown, no error). A shell-form ENTRYPOINT additionally "ignores any CMD or docker run command line arguments" — a CMD beneath it is silently dropped. Use exec form; a setup wrapper must hand off PID 1 with exec "$@".
Separate `apt-get update` / `install` layers install stale packages. Docker caches a RUN by its literal command string, so a standalone RUN apt-get update is reused even after the upstream index moves; editing only the install line rebuilds against the stale index, silently reintroducing outdated/CVE-laden packages. Keep them in one RUN, pin versions as an extra cache-bust trigger, clean lists in the same layer.
Gotchas
`set -o pipefail` is needed for piped RUNs — but default `/bin/sh` may lack it. POSIX sh reports only the last command's exit code, so RUN wget -O- url | sh exits 0 even when wget fails, committing a broken layer. dash (Debian) and ash (Alpine) don't support -o pipefail; set it Dockerfile-wide via SHELL.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 73 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/loom-docker/SKILL.md
Popularity
- Repository stars
- 56
- Repository forks
- 3
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cosmix/loom/loom-docker)