/polymath-devops:dockerizefrom polymath-devops
Write a multi-stage Dockerfile — distroless or minimal base, build/runtime split, deterministic layer order, non-root user, no secrets baked in.
Ships in polymath-devops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write a Dockerfile that's small, fast to rebuild, and safe to run.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
bash, curl, ca-certificates? Often: no.).Before the procedure, resolve the project snapshot —
${POLYMATH_DATA_DIR:-$HOME/.polymath/data}/polymath-core/project-context.json
(ignore it if its _meta.source belongs to another repo; absent → read
.polymath/project.yaml directly; neither → built-in defaults). Then apply
(contract: polymath-core:project-context):
conventions_docs: read role deployment — approved base images,
registries, and hosting targets there override the generic choices
below.golang:1.22-alpine, node:20-alpine, python:3.12-slim).scratch — Go static binaries, Rust musl. Cheapest.gcr.io/distroless/static / base / cc — no shell, no package manager. Recommended for compiled languages.-slim (debian-slim, python-slim) — for languages needing libc + a tiny userspace.-alpine — only if you've validated musl compatibility (Python wheels often don't).go.mod, package.json, requirements.txt).USER 65532:65532). Distroless has nonroot baked in.ENV or ARG. Use BuildKit secret mounts at build time; runtime secrets via your secret manager.org.opencontainers.image.source, .version, .revision. Lets the registry tie images back to a commit.# syntax=docker/dockerfile:1.7
FROM golang:1.22-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/refund ./cmd/refund
FROM gcr.io/distroless/static-debian12:nonroot
WORKDIR /
COPY --from=build /out/refund /refund
USER 65532:65532
ENTRYPOINT ["/refund"]
LABEL org.opencontainers.image.source="https://github.com/example/refund-service"
LABEL org.opencontainers.image.version="0.1.0"
USER is set; not running as root.apt-get install curl bash "just in case"..dockerignore excludes .git, node_modules, build outputs.FROM ubuntu:latest for a Go binary.RUN apt-get update && apt-get install without --no-install-recommends and cleanup.ARG (they remain in the image layer history).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/audit-composeAudit docker-compose.yaml — image pinning, named volumes, networks, secret injection, depends_on health-conditioning./audit-dockerfileAudit a Dockerfile for base-image hygiene, layer order, multi-stage discipline, secret leakage, and missing healthcheck/USER directives./ci-pipeline-githubAuthor a GitHub Actions workflow — lint/test/build/deploy with caching, concurrency control, OIDC for cloud auth, minimal permissions./env-promotionDesign env-promotion (dev → staging → prod) — one artifact promoted, env-specific config injected, gates between stages, rollback path.npx claudepluginhub mohammadbafkar/polymath --plugin polymath-devops