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 14d 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.
- 14d 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 (250 stars, last pushed yesterday), 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.
Other skills, from other repositories
qwenpaw-usage
A QwenPaw command-line guide for setting up scheduled self-checks and packaging a QwenPaw workspace for another server.
server-control
Gives Claude full control over a remote Linux machine via SSH. Use when the user asks to run commands, check server status, manage services, edit files, control Docker, restart services, view logs, or do anything else on the remote machine. Trigger phrases: "run on server", "check the server", "restart", "deploy"…
docker
Manage Docker containers, images, volumes, and docker-compose stacks via the docker CLI.
docker-daemon-privesc
Exploit misconfigured Docker environments, specifically focusing on privilege escalation via an exposed Docker daemon socket (docker.sock) or membership in the local docker user group to achieve root access on the host system.
analyzing-linux-elf-malware
Analyzes malicious Linux ELF (Executable and Linkable Format) binaries including botnets, cryptominers, ransomware, and rootkits targeting Linux servers, containers, and cloud infrastructure. Covers static analysis, dynamic tracing, and reverse engineering of x8664 and ARM ELF samples. Activates for requests involving…
alpine
Alpine Linux reference — the minimal, security-oriented distribution for containers. Covers apk package management, Docker optimization, multi-stage builds, musl vs glibc compatibility, OpenRC system admin, security hardening, and common troubleshooting.