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.
git clone --depth 1 https://github.com/pjt222/agent-almanacnpx agentmods add skills/pjt222/agent-almanac/create-multistage-dockerfileWrote 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/pjt222/agent-almanac/create-multistage-dockerfile)<a href="https://agentmods.dev/skills/pjt222/agent-almanac/create-multistage-dockerfile"><img src="https://agentmods.dev/badge/skills/pjt222/agent-almanac/create-multistage-dockerfile/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/pjt222/agent-almanac/create-multistage-dockerfile"><img src="https://agentmods.dev/badge/skills/pjt222/agent-almanac/create-multistage-dockerfile.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.00089 | $0.01952 |
| Opus 5.5 | $0.00036 | $0.00781 |
| Sonnet 5.5 | $0.00018 | $0.00390 |
| Haiku 4.5 | $0.00009 | $0.00195 |
Grade C, and why
create-multistage-dockerfile scanned grade C 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 3mo 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
RUN apt-get update && apt-get install -y musl-tools && rm -rf /var/lib/apt/lists/* How it starts
The opening of the file, as written. The whole thing — 230 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Create Multi-Stage Dockerfile
Build multi-stage Dockerfiles that produce minimal production images by separating build tooling from runtime.
When to Use
- Production images are too large (>500MB for compiled languages)
- Build tools (compilers, dev headers) are included in the final image
- Need separate images for development and production from one Dockerfile
- Deploying to constrained environments (edge, serverless)
Inputs
- Required: Existing Dockerfile or project to containerize
- Required: Language and build system (npm, pip, go build, cargo, maven)
- Optional: Target runtime base (slim, alpine, distroless, scratch)
- Optional: Size budget for final image
Procedure
Step 1: Identify Build vs Runtime Dependencies
| Category | Build Stage | Runtime Stage |
|---|---|---|
| Compilers | gcc, g++, rustc | Not needed |
| Package managers | npm, pip, cargo | Sometimes (interpreted langs) |
| Dev headers | -dev packages |
Not needed |
| Source code | Full source tree | Only compiled output |
| Test frameworks | jest, pytest | Not needed |
Step 2: Structure the Multi-Stage Build
The core pattern: build in a fat image, copy artifacts to a slim image.
# ---- Build Stage ----
FROM <build-image> AS builder
WORKDIR /src
COPY <dependency-manifest> .
RUN <install-dependencies>
COPY . .
RUN <build-command>
# ---- Runtime Stage ----
FROM <runtime-image>
COPY --from=builder /src/<artifact> /<dest>
EXPOSE <port>
CMD [<entrypoint>]
Step 3: Apply Language-Specific Patterns
Node.js (pruned node_modules)
FROM node:22-bookworm AS builder
WORKDIR /src
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build && npm prune --omit=dev
FROM node:22-bookworm-slim
RUN groupadd -r app && useradd -r -g app app
WORKDIR /app
COPY --from=builder /src/dist ./dist
COPY --from=builder /src/node_modules ./node_modules
COPY --from=builder /src/package.json .
USER app
EXPOSE 3000
CMD ["node", "dist/index.js"]
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.
- 3mo ago First seen · 230 lines · 89 tokens per session scan C 44d567b4f055
create-multistage-dockerfile is a skill published in the GitHub repository pjt222/agent-almanac (46 stars, last pushed yesterday), licensed MIT. It adds 89 tokens to every session and 1,952 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
create-multistage-dockerfile compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| create-multistage-dockerfilepjt222/agent-almanac | Skill | 46 | yesterday | MIT | C | 89 | Claude Code |
| wranglercloudflare/skills | Skill | 3.6k | today | Apache-2.0 | A | 60 | Claude Code |
| managing-astro-local-envastronomer/agents | Skill | 465 | yesterday | Apache-2.0 | A | 63 | Claude Code |
| loom-kubernetescosmix/loom | Skill | 66 | 2d ago | MIT | A | 35 | Claude Code |
| loom-kustomizecosmix/loom | Skill | 66 | 2d ago | MIT | A | 15 | Claude Code |
| loom-dockercosmix/loom | Skill | 66 | 2d ago | MIT | A | 9 | Claude Code |
| clawteam.system.setupjavimosch/supercli | Skill | 58 | today | MIT | A | 21 | Claude Code, Codex |