create-multistage-dockerfile

create-multistage-dockerfile is a skill for Claude Code from pjt222/agent-almanac. It costs 89 tokens per session (1,952 once invoked), scanned C, original, MIT.

A Dockerfile that builds an application in one environment and runs it in another, smaller environment. It leaves compilers, test tools, and source code out of the production image.

In plain words
What is it for?
Creating production Docker images for compiled or packaged applications, including projects using npm, pip, Go, Rust, or Maven. It also helps prepare images for edge and serverless deployments.
Why use it?
It helps reduce image size and keeps build-only tools out of the deployed application. It can also produce separate development and production images from one file.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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 agent-almanac plugin — 122 skills, 77 agents shipped together

Good fit Creating production Docker images for compiled or packaged applications, including projects using npm, pip, Go, Rust, or Maven. It also helps prepare images for edge and serverless deployments.

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/pjt222/agent-almanac
agentmods
npx agentmods add skills/pjt222/agent-almanac/create-multistage-dockerfile

Made for: Claude Code.

Or install agent-almanac, the plugin that ships this one along with the rest of its 122 skills, 77 agents.

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 create-multistage-dockerfile

README.md
[![agentmods](https://agentmods.dev/badge/skills/pjt222/agent-almanac/create-multistage-dockerfile/github.svg)](https://agentmods.dev/skills/pjt222/agent-almanac/create-multistage-dockerfile)
Your own site
<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.

agentmods 80×15 button for create-multistage-dockerfile

Your own site · 80×15
<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>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,952 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00089 $0.01952
Opus 5.5 $0.00036 $0.00781
Sonnet 5.5 $0.00018 $0.00390
Haiku 4.5 $0.00009 $0.00195

Measured 3mo ago against content hash 44d567b4f055, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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/*
i18n/caveman-lite/skills/create-multistage-dockerfile/SKILL.md · 230 lines

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"]

Read the full file on GitHub · 230 lines

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. 3mo ago First seen · 230 lines · 89 tokens per session scan C 44d567b4f055

Subscribe to this mod's changes

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.

Related

create-multistage-dockerfile compared with skills from other repositories

create-multistage-dockerfile next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
create-multistage-dockerfilepjt222/agent-almanacSkill46yesterdayMITC89Claude Code
wranglercloudflare/skillsSkill3.6ktodayApache-2.0A60Claude Code
managing-astro-local-envastronomer/agentsSkill465yesterdayApache-2.0A63Claude Code
loom-kubernetescosmix/loomSkill662d agoMITA35Claude Code
loom-kustomizecosmix/loomSkill662d agoMITA15Claude Code
loom-dockercosmix/loomSkill662d agoMITA9Claude Code
clawteam.system.setupjavimosch/supercliSkill58todayMITA21Claude Code, Codex