Agent skill

Docker

by ericrisco in ericrisco/rsc-harness

A skill your agent uses when authoring or auditing a Dockerfile, shrinking a bloated image, hardening a container that runs as root, picking a base image, or wiring a Compose dev loop with hot reload.

MITAuto-check: notesDevOps & Cloud

Install Docker

skills CLI
$ npx skills add ericrisco/rsc-harness --skill docker -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ericrisco/rsc-harness docker --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/docker .claude/skills/docker && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
docker
GitHub stars
156
Token cost
~2.7k tokens
SKILL.md length
913 words
Files
6 (incl. scripts, references)
Skills in repo
229
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when authoring or auditing a Dockerfile, shrinking a bloated image, hardening a container that runs as root, picking a base image, or wiring a Compose dev loop with hot reload.

  • Auditing a Dockerfile
  • SKILL.md covers When NOT to use — and who owns…, Pick a base image (2026 reality), Multi-stage skeletons and .dockerignore — load-bearing,…, plus 4 more sections
  • Runs Shell scripts from its folder; calls docker, trivy and apt-get; needs NPM_TOKEN and POSTGRES_PASSWORD
  • Shrinking a bloated image

What it does

Docker is an agent skill from ericrisco/rsc-harness. Use when authoring or auditing a Dockerfile, shrinking a bloated image, hardening a container that runs as root, picking a base image, or wiring a Compose dev loop with hot reload. NOT CI builds or deploy-to-host (that is deployment), NOT k8s autoscaling (that is scaling), NOT app-level injection or secrets-in-code (that is secure-coding).

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/base-images-and-stages.md`).

It sits in DevOps & Cloud, covering Containers, Container orchestration and Secure coding. It works with Docker and Kubernetes. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.

When your agent uses it

  • Auditing a Dockerfile
  • Shrinking a bloated image
  • Hardening a container that runs as root
  • Picking a base image

Example prompts

  • “/docker”

Requirements

  • Python 3
  • A Bash shell
  • Docker
  • A credential in NPM_TOKEN

What it can do on your machine

Read from SKILL.md and the folder at commit 92fde8f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • docker
    • trivy
    • apt-get
    • npm
    • hadolint
    • sh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use docker and npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • NPM_TOKEN
    • POSTGRES_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Docker loads about 2.7k tokens when it runs, and up to ~4.6k if it reads all its reference files. Until then it costs about 89 tokens; SKILL.md has 913 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:127
    text (including `.git`, `node_modules`, `.env`) ships to the daemon: it
  • NoteMentions a .env fileSKILL.md:135
    .env
  • NoteMentions a .env fileSKILL.md:136
    .env.*
  • NoteMentions a .env fileSKILL.md:248
    + build outputs | whole context ships; `.env`/`.git` can leak |

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ericrisco/rsc-harness at commit 92fde8f, republished under its MIT licence (© ericrisco). 913 words, ~2,729 tokens.

Download SKILL.mdSave it as .claude/skills/docker/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
docker
description
Use when authoring or auditing a Dockerfile, shrinking a bloated image, hardening a container that runs as root, picking a base image, or wiring a Compose dev loop with hot reload. NOT CI builds or deploy-to-host (that is `deployment`), NOT k8s autoscaling (that is `scaling`), NOT app-level injection or secrets-in-code (that is `secure-coding`).
tags
docker, containers, dockerfile, compose, image-security
recommends
deployment, secure-coding, scaling, github-actions
origin
risco

docker — container-craft

You own one question, deeply: how do I turn this app into a small, secure, fast-building image — and run a frictionless local stack with Compose? Your artifacts are the Dockerfile, the .dockerignore, and the compose.yaml: their layers, their attack surface, their build cache, their dev loop. You do not touch what happens after the image is built.

text
source  →  Dockerfile (multi-stage, cache mounts)  →  small + scanned image  +  compose.yaml (dev loop)
                                                            └──────────────┬──────────────┘
                                                    hand off to ../deployment/SKILL.md

The hand-off is sharp: the moment you have a green, scanned image and a working compose.yaml, you are done. Everything downstream is ../deployment/SKILL.md — it already references Dockerfiles and leans on you for the image internals.

When NOT to use — and who owns it instead

You're asked for…OwnerWhy it's not you
CI build, registry push, deploy to host, rollback../deployment/SKILL.mdYou build + harden the image; it moves the image through CI to prod
k8s manifests, HPA autoscaling, ingressscalingOrchestration above a single image
App SQL injection, secrets in source, dep CVE triage../secure-coding/SKILL.mdYou cover only image/container hardening
Install/operate a self-hosted PaaS../coolify/SKILL.mdHost operation, not the image
Containerless PaaS deploy mechanics../railway/SKILL.md, ../fly-io/SKILL.mdPlatform deploy, not the Dockerfile

Pick a base image (2026 reality)

BaseSizeCVE / patch velocityDebuggable?Wins when
*-slim (e.g. bookworm-slim)~30–80 MBmoderate, glibcyes (shell, apt)pragmatic default, native deps / Python wheels
distroless (gcr.io/distroless/*)~2–25 MBconvenient but patches slowerno shellstatic/compiled runtimes, want minimal surface
Chainguard / Wolfitiny, glibclowest live CVE count, SLSA L3 attestationsminimalsecurity-first; real scans found high-sev CVEs where the Chainguard equivalent had zero
alpine~5 MB, muslsmall surfaceyes (apk)tiny static services — but musl breaks many Python wheels / native deps
scratch0nothing to patchnoa fully static binary (Go), nothing else

Rule of thumb: glibc app with native deps → *-slim or Wolfi. Static Go binary → scratch or distroless/static. Security mandate → Chainguard. Reach for alpine only when you've confirmed your wheels/native libs build against musl. Per-language tag maps, multi-stage templates for the stacks not shown below (Rust, JVM jlink, static SPA → nginx) and multi-arch buildx live in references/base-images-and-stages.md.

Multi-stage skeletons

Node — npm ci with a cache mount → distroless nonroot. Bad: single-stage node:20 ≈ 1.1 GB. Good: this ≈ 180 MB. Tags track Node 24 (the active LTS as of mid-2026); Node 22 is in Maintenance LTS, so swap 24→22 only when you deliberately want the conservative maintenance line.

dockerfile
# syntax=docker/dockerfile:1
FROM node:24-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci
COPY . .
RUN npm run build && npm prune --omit=dev

FROM gcr.io/distroless/nodejs24-debian13:nonroot
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
USER nonroot
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s CMD ["node", "dist/healthcheck.js"]
CMD ["dist/server.js"]

Python — uv into a venv → slim, non-root. Bad: python:3.12 + pip ≈ 1 GB. Good: ≈ 130 MB.

dockerfile
# syntax=docker/dockerfile:1
FROM python:3.13-slim-bookworm AS build
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /app
ENV UV_PROJECT_ENVIRONMENT=/opt/venv
COPY pyproject.toml uv.lock ./
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev

FROM python:3.13-slim-bookworm
RUN useradd --create-home --uid 10001 app
COPY --from=build --chown=app:app /opt/venv /opt/venv
COPY --chown=app:app . /app
WORKDIR /app
ENV PATH="/opt/venv/bin:$PATH"
USER app
EXPOSE 8000
HEALTHCHECK CMD ["python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8000/health').status==200 else 1)"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

Go — static binary → scratch. Bad: golang:1.26 ≈ 900 MB. Good: ≈ 12 MB. Pin a supported toolchain: Go maintains only the latest two minors (1.26/1.25 as of mid-2026), so a golang:1.23 build image is two minors past EOL and no longer gets security patches.

dockerfile
# syntax=docker/dockerfile:1
FROM golang:1.26-bookworm AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
    CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /app ./cmd/server

FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /app /app
USER 10001:10001
EXPOSE 8080
ENTRYPOINT ["/app"]

The cache-mount target differs per ecosystem: /root/.npm, /root/.cache/uv (or /root/.cache/pip), /go/pkg/mod. The cache persists across builds without bloating any layer.

.dockerignore — load-bearing, not optional

Without it the entire context (including .git, node_modules, .env) ships to the daemon: it slows the build and can bake secrets into a layer via COPY ..

gitignore
.git
.gitignore
node_modules
dist
.env
.env.*
*.log
.venv
__pycache__
Dockerfile
.dockerignore
README.md

Mirror .gitignore, then add build outputs and the Dockerfile itself.

Harden the runtime

Non-root in the image (already shown above): create a user, COPY --chown, USER. Then lock the runtime down where the container actually runs:

bash
docker run \
  --read-only --tmpfs /tmp \
  --security-opt=no-new-privileges \
  --cap-drop=ALL \
  myimage:1.4.0

--read-only rootfs + --tmpfs /tmp for scratch space; no-new-privileges blocks setuid escalation; --cap-drop=ALL then add back only what you truly need (--cap-add=NET_BIND_SERVICE to bind port < 1024).

Build secrets — never ARG/ENV. An ARG TOKEN lands in the image history and any ENV SECRET=... persists in a layer. Use a BuildKit secret mount; it is never written to a layer:

dockerfile
# Bad — leaks into image history:  ARG NPM_TOKEN
# Good:
RUN --mount=type=secret,id=npm_token \
    NPM_TOKEN="$(cat /run/secrets/npm_token)" npm ci
bash
docker build --secret id=npm_token,env=NPM_TOKEN .
Show full SKILL.md (328 more words)Show less

Compose for dev

Canonical filename is compose.yaml; omit the obsolete version: key; use docker compose (v2 subcommand), never the standalone docker-compose v1. One concern per container — the app, the database and the seed job are separate services. develop.watch is GA since Compose 2.22.0 and gives you a tight dev loop.

yaml
services:
  api:
    build: .
    ports: ["8000:8000"]
    depends_on:
      db:
        condition: service_healthy
    develop:
      watch:
        - action: sync          # hot-reload: copy changed files into the container
          path: ./src
          target: /app/src
        - action: rebuild       # lockfile / compiled langs: rebuild the image
          path: ./uv.lock
        - action: sync+restart  # config change: sync then restart the process
          path: ./config.yaml
          target: /app/config.yaml
  db:
    image: postgres:17-bookworm
    environment:
      POSTGRES_PASSWORD: dev
    volumes: ["pgdata:/var/lib/postgresql/data"]
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 3s
      retries: 5
  seed:
    profiles: ["tools"]         # only runs with: docker compose --profile tools up
    build: .
    command: ["python", "-m", "app.seed"]

volumes:
  pgdata:

Run the dev loop with docker compose watch (or docker compose up --watch). Fuller patterns — watch-per-stack, multi-service healthcheck graphs, override files, env_file vs secrets, and when to graduate to deployment/scaling — are in references/compose-recipes.md.

Verify the image

These are exactly what scripts/verify.sh automates (it skips a tool gracefully if absent):

  • hadolint Dockerfile — static lint of the Dockerfile (no error-level findings).
  • docker compose config -q — the compose.yaml parses and resolves.
  • trivy image myimage:1.4.0 — CVE + misconfig + secret scan of the built image.
  • trivy config . — scan the Dockerfile/compose for misconfiguration without a build.
  • dockle myimage:1.4.0 — CIS-style image hygiene.
  • size check — assert the final image is under your threshold (docker image inspect -f '{{.Size}}').

Anti-patterns

BadGoodWhy
FROM node:latestFROM node:24-bookworm-slim, or pin a digest:latest drifts under you; builds + scans become non-reproducible
runs as root (no USER)USER nonroot / USER 10001PID 1 defaults to root (UID 0), so a container escape == host compromise
ARG TOKEN / ENV SECRET=RUN --mount=type=secret,...ARG/ENV persist in image history & layers
COPY . . then RUN npm cicopy lockfile → install → copy sourcesource edits bust the dep cache layer every build
single FROM, ship the SDKmulti-stage, copy only the artifactruntime carries compilers & dev CVE surface
apt-get install xapt-get install --no-install-recommends x && rm -rf /var/lib/apt/lists/*recommends + apt lists bloat the layer
no .dockerignoremirror .gitignore + build outputswhole context ships; .env/.git can leak
version: "3.8" / docker-compose v1omit version:; docker compose v2the key is obsolete; v1 is EOL
CMD npm start (shell form)CMD ["node", "server.js"] (exec)shell form wraps the process in /bin/sh -c, which swallows SIGTERM — no graceful shutdown
no HEALTHCHECKHEALTHCHECK CMD [...]nothing for Compose/orchestrators to gate readiness on (condition: service_healthy)

© ericrisco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in skills/docker of ericrisco/rsc-harness.

  • SKILL.md
  • evals/README.md
  • evals/cases.yaml
  • references/base-images-and-stages.md
  • references/compose-recipes.md
  • scripts/verify.sh

Open the folder on GitHubat commit 92fde8f

Compare with similar skills

Docker next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Docker compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Docker this skillericrisco/rsc-harness156—~2.7kAutomated safety check: NotesMIT
LangBot Deployment Guidelangbot-app/LangBot18k—~1.2kAutomated safety check: NotesApache-2.0
Debug Openshell ClusterNVIDIA/OpenShell15k—~19kAutomated safety check: NotesApache-2.0
Deploymentmatrixorigin/memoria607—~1.6kAutomated safety check: NotesApache-2.0
Onboarding Validationopen-edge-platform/edge-ai-suites140—~3.3kAutomated safety check: PassApache-2.0
Agenticx DeployerDemonDamon/AgenticX279—~866Automated safety check: PassApache-2.0

Similar skills

  • LangBot Deployment Guide

    langbot-app/LangBot

    Deploys and configures a LangBot instance with Docker Compose or Kubernetes, covering config.yaml, the Box sandbox runtime, the plugin runtime and the global API key.

    18k GitHub stars~1.2k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Debug Openshell Cluster

    NVIDIA/OpenShell

    Official

    Debug why an OpenShell gateway deployment is unhealthy, unreachable, or unable to create sandboxes.

    15k GitHub stars~19k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Deployment

    matrixorigin/memoria

    Deploy Memoria with Docker Compose or Kubernetes. An agent skill from matrixorigin/memoria.

    607 GitHub stars~1.6k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Onboarding Validation

    open-edge-platform/edge-ai-suites

    Validate the get-started experience of Open Edge Platform (OEP) software components from the perspective of a first-time user.

    140 GitHub stars~3.3k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Agenticx Deployer

    DemonDamon/AgenticX

    Guide for deploying AgenticX agents to production including Docker containerization, Kubernetes orchestration, Volcengine AgentKit cloud deployment, and API server setup.

    279 GitHub stars~866 tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Vss Deploy Warehouse Helm

    NVIDIA-AI-Blueprints/video-search-and-summarization

    A skill your agent uses when the user asks to deploy, upgrade, or size the VSS warehouse blueprint (2D / 3D / MV3DT) on Kubernetes via Helm — as opposed to Docker Compose, which is covered by…

    1.9k GitHub stars~4.2k tokensUpdated today
    DevOps & CloudAuto-check passed

More from ericrisco/rsc-harness

All 229 skills in this repo
  • Ab Testing

    ericrisco/rsc-harness

    A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…

    156 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Accessibility

    ericrisco/rsc-harness

    A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…

    156 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ads

    ericrisco/rsc-harness

    A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…

    156 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Agent Eval

    ericrisco/rsc-harness

    A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…

    156 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • AI Media

    ericrisco/rsc-harness

    A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…

    156 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    156 GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Categories

Questions about Docker

What does Docker do?

A skill your agent uses when authoring or auditing a Dockerfile, shrinking a bloated image, hardening a container that runs as root, picking a base image, or wiring a Compose dev loop with hot reload. Docker is an agent skill from ericrisco/rsc-harness. Use when authoring or auditing a Dockerfile, shrinking a bloated image, hardening a container that runs as root, picking a base image, or wiring a Compose dev loop with hot reload.

When should I use Docker?

Docker fits situations like: auditing a Dockerfile; shrinking a bloated image; hardening a container that runs as root; picking a base image.

How do I install Docker in Claude Code?

Run `npx skills add ericrisco/rsc-harness --skill docker -a claude-code`. Or copy the skill folder (skills/docker in ericrisco/rsc-harness) into .claude/skills/docker in your project. Claude Code loads it when a task matches its description.

How do I install Docker in Codex?

Run `npx skills add ericrisco/rsc-harness --skill docker -a codex`. Or copy the skill folder (skills/docker in ericrisco/rsc-harness) into .agents/skills/docker in your project. Codex loads it when a task matches its description.

Can I use Docker in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ericrisco/rsc-harness --skill docker -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docker, .gemini/skills/docker, .github/skills/docker and .opencode/skills/docker in your project.

What does Docker need to run?

Going by SKILL.md and its folder, Docker needs a shell for the scripts in its folder, the command-line tools its instructions call (docker, trivy, apt-get, npm, hadolint and sh) and credentials named NPM_TOKEN and POSTGRES_PASSWORD. Our summary lists: Python 3; A Bash shell; Docker; A credential in NPM_TOKEN.

Does Docker access the network?

SKILL.md contains no URLs. Its commands use docker and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Docker safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Docker use?

Docker is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Docker use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.8k tokens, read only when the agent opens those files.

What are the alternatives to Docker?

Skills that share tags, products or a category with Docker: LangBot Deployment Guide (langbot-app/LangBot, 18k stars), Debug Openshell Cluster (NVIDIA/OpenShell, 15k stars), Deployment (matrixorigin/memoria, 607 stars) and Onboarding Validation (open-edge-platform/edge-ai-suites, 140 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Docker?

ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 156 GitHub stars. The repository holds 229 skills in this directory. The repository was last updated on October 6, 2026.

Source: ericrisco/rsc-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.