Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/cass-2003/local-workflow-skill/dockerfile-bestnpx skills add cass-2003/local-workflow-skill --skill dockerfile-bestgit clone --depth 1 https://github.com/cass-2003/local-workflow-skillWrote 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.svg" alt="Measured on agentmods" 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 | $0.00083 | $0.01798 |
| Sonnet 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 5d 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.
- 5d 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 1mo ago), licensed MIT. It adds 166 tokens to every session and 3,595 once invoked, about $0.0008 per session on Opus 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.
Other skills, from other repositories
deploy-docker-compose
Run the Omnigent server as a Docker compose stack (server + Postgres) on any Docker host — your laptop, a VPS, EC2 by hand, or as the base layer of any container-platform deploy. Invoke when the user wants to build the image, bring up the compose stack, debug the stack on a host they already have, or extend the stack…
compute-env-setup
Set up a reproducible Feynman compute environment for research jobs. Use when a task needs Python/R packages, GPU libraries, containers, Modal, SSH, caches, or managed model runtime setup.
securing-kubernetes-on-cloud
This skill covers hardening managed Kubernetes clusters on EKS, AKS, and GKE by implementing Pod Security Standards, network policies, workload identity, RBAC scoping, image admission controls, and runtime security monitoring. It addresses cloud-specific security features including IRSA for EKS, Workload Identity for…
detecting-privilege-escalation-in-kubernetes-pods
Detect and prevent privilege escalation in Kubernetes pods by monitoring security contexts, capabilities, and syscall patterns with Falco and OPA policies.
implementing-rbac-hardening-for-kubernetes
Harden Kubernetes Role-Based Access Control by implementing least-privilege policies, auditing role bindings, eliminating cluster-admin sprawl, and integrating external identity providers.
docker-socket-mount
Docker / containerd socket mounted into a container → host RCE. Common in CI runners, GitOps controllers (ArgoCD, Flux), and 'Docker-in-Docker' setups. Single-command escape via docker run --rm --privileged -v /:/host alpine chroot /host.