dot-files: Skill for Claude Code

.claude/skills/dockerfile-best-practices/SKILL.md

dockerfile-best-practices is a skill for Claude Code from 2SSK/dot-files. It costs 27 tokens per session (470 once invoked), scanned A, original, MIT.

A guide for writing Dockerfiles, which are recipes for building containers that package an application and its dependencies. It covers smaller images, safer defaults, reproducible builds, and multi-stage builds.

In plain words
What is it for?
Use it when creating Dockerfiles for production applications, including choosing a base image, ordering copies for caching, adding a non-root user, and building a compiled Go program.
Why use it?
It helps avoid oversized images, running applications as root, leaked secrets, and unnecessary rebuilds. Multi-stage builds keep build tools out of the final container.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions OpenCode.

This is 2SSK/dot-files's own configuration. It tells Claude Code how to work on dot-files itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dot-files configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is RUN CGO_ENABLED=0 GOOS=linux go build -o /binary ./cmd/app.

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/2SSK/dot-files/main/.claude/skills/dockerfile-best-practices/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/2SSK/dot-files

Made for: Claude Code.

Wrote 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.

agentmods badge for dockerfile-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/2ssk/dot-files/dockerfile-best-practices/github.svg)](https://agentmods.dev/skills/2ssk/dot-files/dockerfile-best-practices)
Your own site
<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.

agentmods 80×15 button for dockerfile-best-practices

Your own site · 80×15
<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>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 470 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 14d ago against content hash 248df3030cad, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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
.claude/skills/dockerfile-best-practices/SKILL.md · 88 lines

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 .
Changes

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.

  1. 14d ago First seen · 88 lines · 27 tokens per session scan A 248df3030cad

Subscribe to this mod's changes

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.

Related

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.

alibaba/anolisa · 84 tokens

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"…

d0raka/claude-server-control-plugin · 91 tokens

docker

Manage Docker containers, images, volumes, and docker-compose stacks via the docker CLI.

eobarretooo/ClawLite · 19 tokens

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.

ShulkwiSEC/bb-huge · 50 tokens

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…

plurigrid/asi · 88 tokens

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.

bytesagain/ai-skills · 50 tokens