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/KhaledSaeed18/dotclaudenpx agentmods add skills/khaledsaeed18/dotclaude/dockerfile-best-practicesWrote 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/khaledsaeed18/dotclaude/dockerfile-best-practices)<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/dockerfile-best-practices"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/dockerfile-best-practices/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/khaledsaeed18/dotclaude/dockerfile-best-practices"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/dockerfile-best-practices.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.00107 | $0.01484 |
| Opus 5.5 | $0.00043 | $0.00594 |
| Sonnet 5.5 | $0.00021 | $0.00297 |
| Haiku 4.5 | $0.00011 | $0.00148 |
Grade C, and why
dockerfile-best-practices 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 4d 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` steps combined with `&&` and cleanup in the same step (`apt-get install ... && rm -rf /var/lib/apt/lists/*`); a later `rm` does not shrink an earlier layer. How it starts
The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.
A production image contains exactly what the process needs to run, built reproducibly, running as a non-root user, and stopping cleanly when asked. Everything below follows from those four properties.
Structure: multi-stage
# syntax=docker/dockerfile:1.7
FROM node:22.11-bookworm-slim AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN corepack enable && pnpm install --frozen-lockfile --prod=false
FROM deps AS build
COPY . .
RUN pnpm build && pnpm prune --prod
FROM node:22.11-bookworm-slim AS runtime
ENV NODE_ENV=production
WORKDIR /app
RUN groupadd -r app && useradd -r -g app -d /app app
COPY --from=build --chown=app:app /app/node_modules ./node_modules
COPY --from=build --chown=app:app /app/dist ./dist
COPY --chown=app:app package.json ./
USER app
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s CMD node dist/healthcheck.js
ENTRYPOINT ["node", "dist/server.js"]
Build stages hold compilers and dev dependencies; the runtime stage copies artifacts only.
Rules
Base images
- Pin to a specific version tag (
22.11-bookworm-slim), and for reproducible builds pin the digest (@sha256:...) with a tool (Renovate, Dependabot) to bump it. - Prefer
-slimor distroless overalpinefor glibc-dependent runtimes (Node native modules, Python wheels); alpine for Go static binaries is fine. - One process per container; no supervisord.
Layers and cache
- Order from least to most frequently changed: base, system packages, dependency manifests, dependency install, source, build. Copy lockfiles before source so dependency layers cache.
RUNsteps combined with&&and cleanup in the same step (apt-get install ... && rm -rf /var/lib/apt/lists/*); a laterrmdoes not shrink an earlier layer..dockerignorewith.git,node_modules, build output,.env*, tests, docs; without it the build context and the cache invalidation are both wrong.- BuildKit cache mounts for package managers:
RUN --mount=type=cache,target=/root/.npm npm ci.
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.
- 4d ago Changed · +1 lines ae06546e23f5
- 2mo ago First seen · 81 lines · 107 tokens per session scan C d7a07860e992
dockerfile-best-practices is a skill published in the GitHub repository KhaledSaeed18/dotclaude (8 stars, last pushed today), licensed MIT. It adds 107 tokens to every session and 1,484 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-22.
dockerfile-best-practices compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| dockerfile-best-practicesKhaledSaeed18/dotclaude | Skill | 8 | today | MIT | C | 107 | Claude Code |
| docker-debuggerOneWave-AI/claude-skills | Skill | 458 | yesterday | MIT | A | 35 | Claude Code, Codex |
| agents-v2-pylingxling/awesome-skills-cn | Skill | 343 | 1mo ago | MIT | A | 39 | Claude Code |
| factory-environment-setupcurie-eng/curie | Skill | 54 | today | Apache-2.0 | A | 38 | Claude Code |
| factory-environment-maintenancecurie-eng/curie | Skill | 54 | today | Apache-2.0 | A | 46 | Claude Code |
| devopsMindrally/skills | Skill | 325 | 1mo ago | Apache-2.0 | A | 25 | Claude Code |
| dockerMindrally/skills | Skill | 325 | 1mo ago | Apache-2.0 | A | 16 | Claude Code |