Borrowing it
Nothing to install: this file belongs to Everyone-Needs-A-Copilot/claude-copilot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Everyone-Needs-A-Copilot/claude-copilot/main/.claude/skills/devops/docker-patterns/SKILL.mdgit clone --depth 1 https://github.com/Everyone-Needs-A-Copilot/claude-copilotWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/everyone-needs-a-copilot/claude-copilot/docker-patterns)<a href="https://agentmods.dev/skills/everyone-needs-a-copilot/claude-copilot/docker-patterns"><img src="https://agentmods.dev/badge/skills/everyone-needs-a-copilot/claude-copilot/docker-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/everyone-needs-a-copilot/claude-copilot/docker-patterns"><img src="https://agentmods.dev/badge/skills/everyone-needs-a-copilot/claude-copilot/docker-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00085 | $0.02195 |
| Opus 5.5 | $0.00034 | $0.00878 |
| Sonnet 5.5 | $0.00017 | $0.00439 |
| Haiku 4.5 | $0.00009 | $0.00219 |
Grade B, and why
docker-patterns scanned grade B with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Asks for rootlowPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
- [ ] **Non-root user** — always set `USER` directive; never run as root in production Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Recursive force deletemediumDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
&& rm -rf /var/lib/apt/lists/* Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
CMD wget -qO- http://localhost:3000/health || exit 1 How it starts
The opening of the file, as written. The whole thing — 239 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Docker Patterns
Dockerfile optimisation, multi-stage builds, image security, and container best practices. Run the linter on every Dockerfile before review; use this prose guidance to explain findings and propose fixes.
Purpose
- Produce small, secure production images using multi-stage builds
- Maximise layer cache hit rate to speed up CI pipelines
- Eliminate common image security vulnerabilities
- Ensure containers are production-ready with health checks
Multi-Stage Build Pattern
Split the image into a builder stage (compile / install) and a runtime stage (minimal base). Never ship build tools in production images.
# syntax=docker/dockerfile:1
# Stage 1: Builder
FROM node:20-alpine AS builder
WORKDIR /app
# Copy dependency manifests first (cache layer)
COPY package.json package-lock.json ./
RUN npm ci --frozen-lockfile
# Copy source and build
COPY . .
RUN npm run build
# Stage 2: Runtime (never includes node_modules/devDependencies or build tools)
FROM node:20-alpine AS runtime
WORKDIR /app
# Non-root user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser
# Copy only production artefacts from builder
COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
COPY --from=builder --chown=appuser:appgroup /app/node_modules ./node_modules
EXPOSE 3000
ENTRYPOINT ["node", "dist/server.js"]
Why this matters: A typical Node.js image with dev dependencies can reach 800MB+. The runtime-only image is typically under 100MB.
Layer Caching Optimisation
Docker caches each instruction. If a layer's checksum changes, all subsequent layers are invalidated.
Optimal ordering (least-to-most-frequently-changing):
# 1. Base image (changes rarely)
FROM python:3.12-slim
# 2. System dependencies (changes rarely)
RUN apt-get update && apt-get install -y --no-install-recommends \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# 3. App dependency manifests (changes when you add/remove packages)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 4. Source code (changes every commit — LAST)
COPY . .
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 239 lines · 85 tokens per session scan B c7471a90b4b0
docker-patterns is a skill published in the GitHub repository Everyone-Needs-A-Copilot/claude-copilot (14 stars, last pushed yesterday), licensed MIT. It adds 85 tokens to every session and 2,195 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 3 findings (asks for root, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.
Other skills, from other repositories
relay-docker
Build production-ready Dockerfiles with multi-stage builds, security hardening, and docker-compose for local dev. Use when asked to "create Dockerfile", "optimize container", or "dockerize this".
devops-commander
Activates the DevOps-Commander agent for infrastructure, CI/CD, and cloud operations. Use when you need GitHub Actions or GitLab CI pipeline design, Dockerfile and docker-compose configuration, Kubernetes deployment manifests, Terraform/Pulumi infrastructure as code, Prometheus + Grafana monitoring setup, or incident…
compose
A guide to Docker Compose, a tool for defining and running applications made of multiple containers, such as a web app, API, and database.
networking
A guide to Docker container networking, which controls how containers communicate with each other, the host computer, and other machines. It explains bridge, host, none, overlay, and macvlan network modes.
container-ops
A reference for operating Docker containers, which are isolated environments used to run applications and their dependencies. It covers starting, stopping, inspecting, entering, monitoring, and removing containers.
docker-expert
Expert-level Docker containerization, image optimization, and container orchestration. Use this skill for building efficient Docker images, managing containers, and implementing Docker best practices.