← ClaudeAtlas

dockerlisted

Build small, secure, reproducible container images and compose stacks. Use when writing or reviewing a Dockerfile, debugging a bloated/slow image build, setting up docker-compose for local dev, adding a healthcheck, handling build secrets, or hardening a container (non-root, minimal base). Triggers — "Dockerfile", "docker build", "docker-compose", "containerize", "image is huge", "layer cache", "multi-stage", any `Dockerfile`/`compose.yaml`. Pairs with deployment-cicd (CI builds + registries + k8s — this skill is the image/compose craft), linux-sysadmin (the host), security-web (runtime hardening).
kouroshez/coding-os · ★ 4 · DevOps & Infrastructure · score 76
Install: claude install-skill kouroshez/coding-os
# Docker — Images & Compose An image is a liability proportional to its size and privilege: every MB ships, every package is attack surface, every root container is a host risk. The craft is small, reproducible, least-privilege images. CI/CD, registries, and orchestration belong to [deployment-cicd](../deployment-cicd/SKILL.md); this skill is the Dockerfile and compose itself. > Lint a Dockerfile against the rules below: > `bash scripts/lint_dockerfile.sh path/to/Dockerfile` ## Multi-stage — build fat, ship thin ```dockerfile # Wrong — toolchain + source + caches all ship; 1.2 GB; runs as root FROM node:26 COPY . . RUN npm install && npm run build CMD ["node", "dist/server.js"] # Correct — build stage discarded; runtime carries only the artifact; ~180 MB FROM node:26-slim AS build WORKDIR /app COPY package*.json ./ RUN npm ci # ci (not install) = reproducible, lockfile-exact COPY . . RUN npm run build FROM node:26-slim AS runtime WORKDIR /app ENV NODE_ENV=production COPY --from=build /app/dist ./dist COPY --from=build /app/node_modules ./node_modules USER node # never run as root EXPOSE 8080 HEALTHCHECK CMD node healthcheck.js || exit 1 CMD ["node", "dist/server.js"] ``` The build stage carries compilers and dev deps; the runtime stage copies only the artifact. Result is smaller, faster to pull, and has less attack surface. Full optimization → [references/dockerfile-optimization.md](references/dockerfile-optimization.md). ##