skills/docker-expert/SKILL.md
Use this skill when containerizing services or debugging Docker workflows, including production Dockerfiles, Compose setups, reproducible builds, secure defaults, image size, caching, and runtime behavior.
npx skillsauth add chatandbuild/chatchat-skills Docker ExpertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create containers that are small, secure, and predictable across local and CI environments.
Dockerfile.Base image selection: Prefer alpine for minimal size when musl compatibility is acceptable; use distroless for maximum security (no shell, minimal attack surface); use debian-slim when glibc or common tools are required. Pin major.minor version (e.g. node:20-alpine3.19) and avoid latest.
Multi-stage builds: Use a builder stage for compilation and a minimal runtime stage. Copy only artifacts with COPY --from=builder:
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
RUN npm run build
FROM node:20-alpine
RUN addgroup -g 1000 app && adduser -u 1000 -G app -D app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
USER app
CMD ["node", "dist/index.js"]
Layer ordering: Copy dependency manifests (package.json, requirements.txt, go.mod) before source code. Install dependencies in a separate RUN. This maximizes cache reuse when only source changes.
BuildKit cache mounts: For package managers, use cache mounts to speed repeated builds:
RUN --mount=type=cache,target=/root/.npm \
npm ci --omit=dev
Configure .dockerignore: Exclude node_modules, .git, .env*, *.log, and build artifacts. Missing entries bloat context and can leak secrets.
Non-root execution: Create a dedicated user, set USER, and use explicit WORKDIR. Prefer CMD with exec form ["executable", "arg1"] over shell form for proper signal handling.
Compose: Define depends_on with condition: service_healthy where applicable. Use env files for overrides, not hardcoded values.
apt-get update && apt-get install -y ... && rm -rf /var/lib/apt/lists/* in one RUN to avoid bloating layers.npm install or pip install invalidates cache on every code change. Copy manifests first, install, then copy source..dockerignore: Without it, node_modules, .git, and local .env can be sent as build context, causing slow builds and potential secret leakage.exec or use tini/dumb-init if a shell script is required.COPY; ADD has URL and archive-extraction behavior that can surprise. Use COPY for deterministic, explicit behavior.trivy image <image> or grype <image> in CI. Fix critical/high CVEs before release.securityContext: { readOnlyRootFilesystem: true } in Kubernetes; ensure writable paths use tmpfs or volumes.--cap-drop=ALL and add back only what is needed. Avoid --privileged.Return:
Dockerfile/Compose changes with inline examples where helpfuldocker build -t <tag> . and verification: docker run --rm <tag>trivy image <tag> or equivalentlatest tags in production workflows.npm ci, pip install -r requirements.txt with pinned versions).ADD when COPY suffices.tools
Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).
development
Use 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, .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.
development
Use this skill when turning messy workout information into clear logs, comparing user-provided sessions, surfacing trends or likely PRs, and suggesting realistic next-session steps.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.