docker-patterns

docker-patterns is a skill for Claude Code from shennawardana23/skillme. It costs 109 tokens per session (2,254 once invoked), scanned A, original, Apache-2.0.

A guide for writing and reviewing Dockerfiles and Docker Compose setups, mainly for Go services. Docker packages an application with what it needs to run, while Compose defines how local containers work together.

In plain words
What is it for?
Use it to create multi-stage Go images, configure local services, networks, and volumes, and check container security.
Why use it?
It helps avoid oversized, insecure, or incorrectly connected containers during development and image building.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /server ./cmd/server.

Part of the skillme plugin — 137 skills, 2 commands shipped together

Good fit Use it to create multi-stage Go images, configure local services, networks, and volumes, and check container security.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/shennawardana23/skillme
agentmods
npx agentmods add skills/shennawardana23/skillme/docker-patterns

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 137 skills, 2 commands.

Wrote 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.

agentmods badge for docker-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/shennawardana23/skillme/docker-patterns.svg)](https://agentmods.dev/skills/shennawardana23/skillme/docker-patterns)
Your own site
<a href="https://agentmods.dev/skills/shennawardana23/skillme/docker-patterns"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/docker-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 109 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,254 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00109 $0.02254
Opus 5 $0.00055 $0.01127
Sonnet 5 $0.00022 $0.00451
Haiku 4.5 $0.00011 $0.00225

Measured 7d ago against content hash b400b81512a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

docker-patterns scanned grade A with 1 finding 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 7d 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.

USER nonroot:nonroot # 3. never run as root

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/docker-patterns/SKILL.md · 263 lines

How it starts

The opening of the file, as written. The whole thing — 263 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Docker Patterns

This skill covers building the image and running it locally. What to do with that image in production (rollout strategy, health probes, rollback) is deployment-patterns; how it gets built and pushed in automation is ci-cd-and-automation.

Multi-stage Dockerfile (Go)

Go's static binary output makes a minimal final image straightforward — this should be the default shape for any Go service in this organization:

# Stage 1: build
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /server ./cmd/server

# Stage 2: minimal runtime — no shell, no package manager, no Go toolchain
FROM gcr.io/distroless/static-debian12:nonroot AS runner
COPY --from=builder /server /server
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["/server"]

distroless/static has no shell — this is a deliberate security choice (smaller attack surface, nothing for an attacker to exec into even with a code-execution bug), not an oversight. If you genuinely need shell debugging in the runtime image, use distroless/static-debian12:debug (adds busybox) rather than reverting to a full Alpine/Debian base for every service.

Copying go.mod/go.sum before the rest of the source lets Docker cache the go mod download layer across builds where only application code changed — reordering COPY . . before dependency install defeats this caching and slows every rebuild.

Multi-stage Dockerfile (TypeScript/Node)

FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci

FROM node:22-alpine AS build
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build && npm prune --production

FROM node:22-alpine AS production
WORKDIR /app
RUN addgroup -g 1001 -S appgroup && adduser -S appuser -u 1001 -G appgroup
USER appuser
COPY --from=build --chown=appuser:appgroup /app/dist ./dist
COPY --from=build --chown=appuser:appgroup /app/node_modules ./node_modules
COPY --from=build --chown=appuser:appgroup /app/package.json ./
ENV NODE_ENV=production
EXPOSE 3000
CMD ["node", "dist/server.js"]

Read the full file on GitHub · 263 lines

Files

What ships with it

1 file 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.

Changes

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.

  1. 7d ago First seen · 263 lines · 109 tokens per session scan A b400b81512a3

Subscribe to this mod's changes

docker-patterns is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 10d ago), licensed Apache-2.0. It adds 109 tokens to every session and 2,254 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

writing-skills

Use when creating new skills, editing existing skills, or verifying skills work before deployment.

obra/superpowers · 20 tokens

receiving-code-review

Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation.

obra/superpowers · 38 tokens

writing-plans

Use when you have a spec or requirements for a multi-step task, before touching code.

obra/superpowers · 21 tokens

build-mcpb

This skill should be used when the user wants to "package an MCP server", "bundle an MCP", "make an MCPB", "ship a local MCP server", "distribute a local MCP", discusses ".mcpb files", mentions bundling a Node or Python runtime with their MCP server, or needs an MCP server that interacts with the local filesystem…

anthropics/claude-plugins-official · 98 tokens

skill-creator

Create, improve, evaluate, benchmark skills. Use when authoring a new skill, updating an existing one, running evals, or optimizing a skill's description for triggering. Don't use for invoking skills, writing prose, or scaffolding Python projects.

luongnv89/asm · 54 tokens

skill-index-updater

Add GitHub skill repos to the ASM index: clone, audit, eval, regenerate index, rebuild catalog, open PR. Use when given GitHub URLs to onboard. Don't use for authoring (skill-creator), improving (skill-auto-improver), or install (asm install).

luongnv89/asm · 63 tokens