Borrowing it
Nothing to install: this file belongs to 2SSK/dot-files. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/2SSK/dot-files/main/.claude/skills/dockerfile-best-practices/SKILL.mdgit clone --depth 1 https://github.com/2SSK/dot-filesWrote 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/2ssk/dot-files/dockerfile-best-practices)<a href="https://agentmods.dev/skills/2ssk/dot-files/dockerfile-best-practices"><img src="https://agentmods.dev/badge/skills/2ssk/dot-files/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/2ssk/dot-files/dockerfile-best-practices"><img src="https://agentmods.dev/badge/skills/2ssk/dot-files/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.00027 | $0.00470 |
| Opus 5.5 | $0.00011 | $0.00188 |
| Sonnet 5.5 | $0.00005 | $0.00094 |
| Haiku 4.5 | $0.00003 | $0.00047 |
Grade A, and why
dockerfile-best-practices scanned grade A 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 1mo 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.
Asks for rootlowPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
# Never run as root Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
CMD wget -q --spider http://localhost:8080/healthz || exit 1 What it actually says
Docker Best Practices
Secure, optimized Dockerfiles for production containers.
Core Principles
- Small: Minimal layers, minimal size
- Secure: Non-root user, read-only where possible
- Fast: Multi-stage builds, layer caching
- Reproducible: Deterministic builds
Multi-Stage Builds
# Build stage
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /binary ./cmd/app
# Runtime stage
FROM alpine:3.20
RUN adduser -D -u 1000 appuser
WORKDIR /app
COPY --from=builder /binary /app/app
USER appuser
ENTRYPOINT ["/app/app"]
Security
# Never run as root
USER appuser
# Read-only filesystem (where possible)
# HEALTHCHECK for monitoring
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget -q --spider http://localhost:8080/healthz || exit 1
Optimization
# Order: least frequently changed → most frequently changed
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build
# This way, go.mod changes trigger cache rebuild, not code changes
Best Practices Checklist
- Minimal base image (alpine, distroless)
- Non-root user
- Multi-stage build
- No secrets in image
- Health check defined
- Labeled metadata
- Layer caching optimized
Build Commands
# Build
docker build -t app:latest .
# Scan for vulnerabilities
hadolint Dockerfile
trivy image app:latest
# Build with buildkit
DOCKER_BUILDKIT=1 docker build -t app:latest .
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.
- 1mo ago First seen · 88 lines · 27 tokens per session scan A 248df3030cad
dockerfile-best-practices is a skill published in the GitHub repository 2SSK/dot-files (258 stars, last pushed 9d ago), licensed MIT. It adds 27 tokens to every session and 470 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.
dockerfile-best-practices compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| dockerfile-best-practices2SSK/dot-files | Skill | 258 | 9d ago | MIT | A | 27 | Claude Code |
| qwenpaw-usagealibaba/anolisa | Skill | 688 | 8d ago | Apache-2.0 | B | 84 | Claude Code, Codex |
| server-controld0raka/claude-server-control-plugin | Skill | 2 | 1mo ago | MIT | A | 91 | Claude Code |
| docker-daemon-privescShulkwiSEC/bb-huge | Skill | 27 | 4mo ago | MIT | A | 50 | Claude Code, Codex |
| dockereobarretooo/ClawLite | Skill | 52 | 5mo ago | MIT | A | 19 | Claude Code, Codex |
| analyzing-linux-elf-malwareplurigrid/asi | Skill | 72 | 1mo ago | MIT | B | 88 | Claude Code |
| alpinebytesagain/ai-skills | Skill | 16 | 7mo ago | none | A | 50 | Claude Code, Codex |