/devops-skills:containerizationfrom devops-skills
Guides building small, reproducible, and secure container images. Covers Dockerfile layer ordering, multi-stage builds, base image pinning, and non-root users.
Ships in devops-skills. 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.
A container image is a build artifact meant to be byte-identical everywhere it runs. Most Dockerfile trouble comes from treating it like a virtual machine — installing a shell's worth of tools, running as root, and rebuilding the world on every code change.
Aim for three properties: small, reproducible, and least-privileged. A change that does not move one of those is not worth making.
For language-specific multi-stage templates, distroless runtimes, and BuildKit cache and secret
mounts, read references/dockerfile-patterns.md.
Docker caches per layer and invalidates every layer after the first change. Put the stable things first so a one-line edit does not re-download the internet:
COPY package.json package-lock.json ./
RUN npm ci # cached until dependencies change
COPY . . # invalidated on every source change
Copying source before installing dependencies means every code change reinstalls everything. This single reordering is usually the largest build-time win available.
Done when: a code-only change does not reinstall dependencies.
A multi-stage build compiles or installs in one stage and copies only the resulting artifact into
a clean final stage. Compilers, headers, and package caches have no business shipping to
production — they add size and give an attacker a toolbox if they land a shell. Name your stages
(AS build, AS runtime) so the final COPY --from=build is unambiguous. Sizing the runtime
image itself — which base to start the final stage from — is image-optimization's job; this
step is about the boundary between building and running.
Done when: the runtime image contains no compiler, package manager cache, or source outside what running requires.
FROM node:latest is not a build input, it is a random number generator — the tag moves under
you and today's build is not tomorrow's. Pin to a digest or an explicit version tag so a rebuild
six months from now produces the same bytes. Then drop privilege: create or reuse a non-root user
and switch to it before the final CMD, so a container escape does not hand over root on the
host. Combine this with a read-only root filesystem and a dropped CAP_* set where the runtime
supports it.
RUN adduser -D app) rather than trusting the base image has one.USER app before CMD/ENTRYPOINT, not after.Done when: the image runs whoami as a non-root UID and rebuilding from the same tag does
not silently change the base layer.
A secret written into any layer — even one later deleted in a subsequent RUN — is still
recoverable from the image history. Use build secrets (RUN --mount=type=secret) or inject
credentials at runtime via the orchestrator's secret store, never ARG/ENV for anything
sensitive, since both are visible in docker history and image inspection. Managing where those
secrets live long-term is secrets-management's job; this step is only about keeping them out of
the artifact you push.
Done when: docker history and docker inspect on the built image show no credentials, keys,
or tokens.
docker runA container that starts fast and exits cleanly is easy to run by hand but painful to operate at
scale unless it also exposes the signals an orchestrator needs. Handle SIGTERM for graceful
shutdown instead of relying on SIGKILL after a timeout. Expose a liveness and readiness
distinction — a process that is running but not yet able to serve traffic should fail readiness,
not liveness. Set resource requests informed by real usage, not guesses, so the scheduler can
place the container sensibly; the scheduling and autoscaling behavior itself belongs to
kubernetes-operations and autoscaling.
SIGTERM and finish in-flight work within the orchestrator's grace period.Done when: the process shuts down cleanly on SIGTERM and reports readiness independently of
liveness.
Everything not excluded by .dockerignore is sent to the build daemon and is a candidate for
accidental inclusion via a stray COPY . .. A bloated context slows every build and risks
shipping .git, local .env files, or test fixtures into a layer. Treat .dockerignore as part
of the Dockerfile, reviewed whenever COPY targets change.
Done when: docker build context transfer size reflects only files the image actually needs.
State the final image size, the base image and how it is pinned, the user the process runs as, and what the build stages separate. Name anything you could not strip from the runtime image and why — that leftover is the remaining attack surface, and naming it is more useful than claiming the image is minimal.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub arjunprabhulal/devops-skills --plugin devops-skills88 skills in this plugin
/alertingCovers designing alerts that page a human only when a human needs to act — symptom-based alerting over cause-based, multi-window burn-rate alerts on error budgets, severity tiers that route between page/ticket/dashboard, requiring every page to link a runbook, and tuning out alert fatigue. Use this whenever the user is writing a new alert rule, asking why on-call is paged too often or missing real incidents, choosing an alert threshold, or designing severity routing. For the SLO the burn-rate math comes from use `slo-definition`, and for what a runbook should contain use `runbooks`./api-gatewayCovers the managed front-door pattern for APIs — request routing, centralized auth, rate limiting and quotas, request/response shaping, and recognizing when a gateway helps versus becomes a bottleneck or single point of failure. Use this whenever the user is designing an API entry point, adding rate limits or quotas, centralizing auth for several backend services, transforming a request between an external and internal contract, or debugging a gateway timeout. For east-west traffic between internal services use `service-connectivity`, and for token issuance details use `iam-access-management`./argocd-operationsCovers running Argo CD day to day — structuring app-of-apps, choosing sync policies and waves, reading health versus sync status correctly, and unsticking a degraded or hung Application. Use this whenever the user mentions Argo CD, an Application stuck "Progressing" or "OutOfSync," app-of-apps or ApplicationSets, sync waves and hooks, or asks why a deploy shows synced but the workload is unhealthy. For the underlying model this tool implements use `gitops`; for automated canary analysis on top of it use `progressive-delivery`; for the workloads it manages use `kubernetes-operations`.