From Docker Expert
Expert Docker: Dockerfiles, multi-stage builds, image size/cache optimization, Compose, and container best practices. Trigger keywords: Docker, Dockerfile, container, image, multi-stage, layer cache, docker-compose, .dockerignore, entrypoint, distroless, non-root, healthcheck, build context. Use for writing/optimizing Dockerfiles, shrinking images, faster builds, or Compose setup.
How this skill is triggered — by the user, by Claude, or both
Slash command
/docker-expert:docker-expertThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Small, reproducible, non-root, cache-friendly. Order layers from least- to most-changing, build in one stage and ship artifacts from another, and never bake secrets into the image.
Small, reproducible, non-root, cache-friendly. Order layers from least- to most-changing, build in one stage and ship artifacts from another, and never bake secrets into the image.
kubernetes-expert.github-master.node:22.4-slim, python:3.12-slim, Alpine, or distroless for runtime. Never :latest (non-reproducible).USER). Copy only what's needed; add a .dockerignore (.git, node_modules, build output, secrets) to shrink the build context and avoid leaking files.RUN steps and clean caches in the same layer (apt-get … && rm -rf /var/lib/apt/lists/*) — a separate cleanup layer doesn't shrink the image.RUN --mount=type=cache) for package managers; pass secrets via --mount=type=secret, never ARG/ENV.CMD/ENTRYPOINT (["node","server.js"]) so signals (SIGTERM) reach the process for graceful shutdown; add --init or tini if your process doesn't reap children.HEALTHCHECK. Configure via env; persist data in volumes, not the writable layer.COPY . . before installing deps → every code change reinstalls everything.:latest / unpinned bases → irreproducible builds.ARG/ENV or layers → baked into history; use build secrets / runtime env.RUN → image doesn't shrink (layers are additive).USER.CMD → PID 1 is the shell, signals don't propagate; container won't shut down cleanly..dockerignore → huge build context, slow builds, leaked files.Multi-stage Node image, cache-friendly, non-root
# ---- build ----
FROM node:22-slim AS build
WORKDIR /app
COPY package*.json ./
RUN --mount=type=cache,target=/root/.npm npm ci # cached unless manifests change
COPY . .
RUN npm run build
# ---- runtime ----
FROM node:22-slim
WORKDIR /app
ENV NODE_ENV=production
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
COPY --from=build /app/dist ./dist
USER node
HEALTHCHECK --interval=30s CMD node -e "fetch('http://localhost:3000/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
CMD ["node", "dist/server.js"]
kubernetes-expert — deploying these images with probes and resources.nodejs-backend-expert / go-expert — the services you containerize.security-expert — image scanning and supply-chain safety.github-master — building/pushing images in CI.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub miaoge-ge/coding-agent-skills --plugin docker-expert