pungrumpy/docker-doctor/docker-author

Claude Code and agent skill by pungrumpy/docker-doctor

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when writing, scaffolding, or refactoring a Dockerfile or Docker Compose file — "write me a Dockerfile", "containerize/dockerize this app", "add Docker", or editing an existing Dockerfile/compose.yaml. Applies production defaults (multi-stage, non-root, pinned slim base, layer caching, .dockerignore, healthcheck) and self-verifies with docker-doctor. Companion to the `docker-doctor` scan skill.

Install

npx vskill@latest install pungrumpy/docker-doctor/docker-author

SKILL.md

Docker Author

Write Dockerfiles and Compose files that pass a docker-doctor scan on the first try. Every default below maps to a rule the scanner enforces — this skill front-loads them so the generated file starts at a high health score instead of being fixed afterward.

The loop: author → npx @docker-doctor/cli@latest . --verbose → fix anything flagged → aim for Excellent 🏆 (score ≥ 90). Don't hand back a Dockerfile you haven't scanned.

Production defaults (each maps to a docker-doctor rule)

Apply these when authoring. If you deviate, say why.

DefaultRule it satisfies
Multi-stage build — a build/deps stage separate from the slim runtime stageuse-multi-stage, avoid-dev-dependencies
Pin the base image to a concrete tag (never latest, never bare) — prefer digest for reproducibilitypin-image-version
Slim/alpine/distroless runtime base (e.g. node:22-alpine, python:3.12-slim)prefer-slim-base
Run as non-root — create a user and USER node / USER 1000 before CMDno-root-user, useradd-no-log-init
No secrets in `ENV`/`ARG` — pass at runtime or use RUN --mount=type=secretno-secrets-in-env
`COPY` not `ADD` (except local tar auto-extract); never ADD a remote URLprefer-copy-over-add, no-add-remote
Cache-friendly layer order — copy manifests + install deps _before_ copying sourceorder-layers
One `RUN` per logical step, &&-chained; apt-get update && apt-get install in the same layerminimize-layers, combine-apt-update-install, avoid-run-cd
Clean package caches in the same layer (rm -rf /var/lib/apt/lists/*, --no-cache, npm ci --omit=dev)clean-package-cache
`SHELL ["/bin/bash", "-o", "pipefail", "-c"]` before piped RUNsuse-pipefail
Absolute `WORKDIR` (e.g. /app), set onceabsolute-workdir
Exec-form `CMD`/`ENTRYPOINT` — JSON array, so signals propagateuse-exec-form
`HEALTHCHECK` for long-running servicesrequire-healthcheck
OCI `LABEL`s (org.opencontainers.image.source, .title, …)require-labels
Sorted multi-line args (alphabetize package lists)sort-multiline-args
Ship a `.dockerignore` (.git, node_modules, build output, secrets)use-dockerignore

Beyond the rules: enable BuildKit and use RUN --mount=type=cache for package managers (faster rebuilds without bloating layers) and RUN --mount=type=secret for build-time credentials (keeps them out of the image).

Canonical multi-stage template (Node — adapt per stack)

dockerfile
# syntax=docker/dockerfile:1
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci
FROM node:22-alpine AS build
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
LABEL org.opencontainers.image.source="https://github.com/acme/app"
COPY --from=build /app/dist ./dist
COPY --from=deps /app/node_modules ./node_modules
USER node
HEALTHCHECK --interval=30s --timeout=3s CMD wget -q --spider http://localhost:3000/health || exit 1
CMD ["node", "dist/server.js"]

Compose defaults (each maps to a Compose rule)

DefaultRule
No top-level `version:` key (obsolete in Compose v2)no-version-key
Resource limits — deploy.resources.limits (cpus/memory) per servicerequire-resource-limits
`restart:` policy (unless-stopped / on-failure)require-restart-policy
`depends_on` with `condition: service_healthy`, not the short list formuse-depends-on-condition
Narrow bind mounts — mount ./data, never /, ~, ~/.ssh, ../ or /etcno-broad-bind-mount
Read-only host mounts — :ro / read_only: true on any bind mount outside the project unless the service writes to itprefer-read-only-bind-mount
No Docker socket bind mount — use_api_socket: true or a filtering proxy insteadno-docker-socket-mount

Verify before handing off

bash
npx @docker-doctor/cli@latest . --verbose

Fix every ERROR, then WARN. If a flagged rule genuinely doesn't apply, don't silently ignore it — either explain the trade-off or configure it (see the docker-doctor skill's references/explain.md). Inside this repo, run bun packages/docker-doctor/src/cli.ts . instead of npx.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
3
Repository forks
2
7-day trend score
12

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/pungrumpy/docker-doctor/docker-author/badge)](https://verified-skill.com/skills/pungrumpy/docker-doctor/docker-author)

Something wrong with this skill or its page? Tell us.