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/cass-2003/local-workflow-skillnpx agentmods add skills/cass-2003/local-workflow-skill/dockerfile-bestWrote 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/cass-2003/local-workflow-skill/dockerfile-best)<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/dockerfile-best"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/dockerfile-best/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/cass-2003/local-workflow-skill/dockerfile-best"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/dockerfile-best.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.00166 | $0.03595 |
| Opus 5.5 | $0.00066 | $0.01438 |
| Sonnet 5.5 | $0.00033 | $0.00719 |
| Haiku 4.5 | $0.00017 | $0.00360 |
Grade C, and why
dockerfile-best scanned grade C with 2 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 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.
gcc libffi-dev && rm -rf /var/lib/apt/lists/* Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
CMD wget --quiet --spider http://localhost:8080/healthz || exit 1 How it starts
The opening of the file, as written. The whole thing — 399 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Dockerfile Best Practices Skill — 镜像构建实战
何时使用
- 写新 Dockerfile / 优化现有镜像
- 镜像太大(> 1GB)需要瘦身
- 排查 layer 缓存命中率低 / 构建慢
- 容器以 root 跑 / 信号收不到 / 僵尸进程
- CI 集成 SBOM / CVE 扫描 / 镜像签名
一、十条铁律
- Multi-stage build — build 阶段与运行阶段分离
- 最小 base image — distroless / scratch / alpine(按需)
- non-root user — 永不以 root 运行
.dockerignore— 比.gitignore更严格- 指令排序按变化频率 — 不变的在前,常变的在后(layer 缓存)
- 复制依赖清单先于源码 —
package.json先COPY+install,再COPY . COPY不用ADD(除非要解压 / URL)- 明确 EXPOSE / HEALTHCHECK — 不依赖默认
- exec form CMD —
CMD ["node","app.js"]而非CMD node app.js - pin 版本 —
node:20.11.1-alpine3.19而非node:latest
二、Multi-stage 标准模板(Node.js)
# ================ Stage 1: deps ================
FROM node:20.11.1-alpine AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN corepack enable && pnpm install --frozen-lockfile --prod=false
# ================ Stage 2: build ================
FROM node:20.11.1-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN corepack enable && pnpm build && pnpm prune --prod
# ================ Stage 3: runner ================
FROM node:20.11.1-alpine AS runner
WORKDIR /app
# non-root
RUN addgroup -S app && adduser -S app -G app
USER app
# 仅拷贝运行时所需
COPY --from=builder --chown=app:app /app/node_modules ./node_modules
COPY --from=builder --chown=app:app /app/dist ./dist
COPY --from=builder --chown=app:app /app/package.json ./
ENV NODE_ENV=production
ENV PORT=8080
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
CMD wget --quiet --spider http://localhost:8080/healthz || exit 1
CMD ["node", "dist/server.js"]
三、Go 应用(极致小)
# ================ build ================
FROM golang:1.22-alpine AS build
WORKDIR /src
# 缓存 modules(独立 layer)
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# 静态链接 + strip
RUN CGO_ENABLED=0 GOOS=linux go build \
-ldflags="-s -w" \
-trimpath \
-o /out/app ./cmd/server
# ================ runtime ================
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=build /out/app /app
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["/app"]
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 · 399 lines · 166 tokens per session scan C 35994a22bf23
dockerfile-best is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 4mo ago), licensed MIT. It adds 166 tokens to every session and 3,595 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
dockerfile-best compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| dockerfile-bestcass-2003/local-workflow-skill | Skill | 12 | 4mo ago | MIT | C | 166 | Claude Code, Codex |
| deploy-docker-composeomnigent-ai/omnigent | Skill | 12k | today | Apache-2.0 | A | 84 | Claude Code, Codex |
| bdd-container-updateNVIDIA-AI-Blueprints/video-search-and-summarization | Skill | 2.0k | today | Apache-2.0 | A | 117 | Cursor |
| securing-kubernetes-on-cloudxalgorix/xalgorix | Skill | 1.6k | today | Apache-2.0 | A | 80 | Claude Code, Codex |
| detecting-privilege-escalation-in-kubernetes-podsxalgorix/xalgorix | Skill | 1.6k | today | Apache-2.0 | A | 40 | Claude Code, Codex |
| docker-socket-mountPurpleAILAB/Decepticon | Skill | 6.9k | 14d ago | Apache-2.0 | B | 67 | Claude Code |
| managing-astro-local-envastronomer/agents | Skill | 466 | yesterday | Apache-2.0 | A | 63 | Claude Code |