dockerfile-hygiene
Dockerfiles that build fast, stay small and do not run as root — layer ordering, multi-stage builds and the cache rules behind them.
Skill by UnicoLab
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/unicolab-dockerfile-hygiene
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/dockerfile-hygiene
What's inside
- Skill name
dockerfile-hygiene- Description
- Dockerfiles that build fast, stay small and do not run as root — layer ordering, multi-stage builds and the cache rules behind them.
- License
- MIT
- Instructions
- 50 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Dockerfile hygiene ```dockerfile # syntax=docker/dockerfile:1 FROM golang:1.23-alpine AS build WORKDIR /src COPY go.mod go.sum ./ # deps first: this layer caches across code edits RUN go mod download COPY . . RUN CGO_ENABLED=0 go build -o /out/app ./cmd/app FROM gcr.io/distroless/static-debian12 COPY --from=build /out/app /app USER nonroot:nonroot ENTRYPOINT ["/app"] ``` ## Layer order is the build time Copy the dependency manifest and install dependencies **before** copying the source. `COPY . .` first invalidates every later layer on any code change, so every build reinstalls everything. ## The rules - **Multi-stage.** The final image should contain the artifact and its runtime, not the compiler, the package index, or the test fixtures. - **Pin the base image** to a version (`python:3.12-slim`, not `python:latest`). `latest` makes a build reproducible only by accident. - **`USER` a non-root account** before `ENTRYPOINT`. Root in a container is root on the host in more configurations than people expect. - **`ENTRYPOINT` in exec form** (`["/app"]`). Shell form wraps the process in `/bin/sh -c`, which swallows `SIGTERM` — the container then takes the full kill timeout to stop on every deploy. - **A `.dockerignore`** with at least `.git`, `node_modules`, build output and local env files. Without one the whole working tree is sent to the daemon and secrets land in layers. - **Never `COPY` a secret**, even if a later layer deletes it — every layer is in the image. Use build secrets (`RUN --mount=type=secret`) or runtime env. - **Combine `apt-get update` with the install** in one `RUN` and clean the lists in the same layer, or the cached index goes stale and the cleanup does nothing. - **`HEALTHCHECK`** when an orchestrator will use it; leave it out when it won't. ## Verify `docker build .` succeeding is not enough — check the final size (`docker images`) and that the process runs as the expected user (`docker run --rm <img> id`, when the image has a shell).
From UnicoLab/smlcode, MIT.
More from UnicoLab/smlcode
- 0.584score
api-versioning
UnicoLab
HTTP API design and evolution — resource shapes, status codes, pagination, and how to change an API without breaking its clients.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
conventional-commits
UnicoLab
Commit and PR messages that survive a `git log` six months later — Conventional Commits, imperative subjects, and what belongs in the body.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
go-table-tests
UnicoLab
Write Go tests the standard way — table-driven subtests, t.Helper, t.Cleanup, and what to assert instead of reflect.DeepEqual.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
hve-rpi
UnicoLab
Hypervelocity Engineering RPI loop (Research, Challenge, Plan, Implement, Review) with FAR rubric and uncertainty tracking.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
hve-security-rai
UnicoLab
STRIDE threat modeling, OWASP/MCSB security planning, OpenSSF/SLSA supply chain hygiene, and NIST AI RMF Responsible AI.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
openshift-manifests
UnicoLab
OpenShift deployment specs that pass the restricted SCC on the first apply — kustomize base/overlays, probes, limits, secrets done safely, and how to explain…
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
pytest-fixtures
UnicoLab
pytest fixtures, parametrize, tmp_path and monkeypatch — the idioms that replace setUp boilerplate and shared mutable state.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
python-typing
UnicoLab
Type hints that actually help — Optional, generics, Protocol, and the mutable-default and import-cycle traps around them.
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
hve-ux-design
UnicoLab
Design Thinking (DFV) and UX architecture for user flows, component hierarchy, and interactive state matrices.
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
go-concurrency
UnicoLab
Goroutine lifetime, context cancellation, channel direction and the mistakes that make Go concurrency leak or race.
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
honest-verification
UnicoLab
Prove the objective was met, not merely that nothing is red — a suite that was already green is not evidence.
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
hve-requirements
UnicoLab
BRD 3-phase discovery, PRD 7-phase specification, Epic/Story/Task decomposition, and Socratic ADR coaching.
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 23, 2026 (2 months ago)
- Last release
- Oct 20, 2026 (9 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/UnicoLab/smlcode
- Website
- unicolab.github.io/smlcode/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from UnicoLab
- 0.584score
hve-rpi
UnicoLab
Hypervelocity Engineering RPI loop (Research, Challenge, Plan, Implement, Review) with FAR rubric and uncertainty tracking.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
hve-security-rai
UnicoLab
STRIDE threat modeling, OWASP/MCSB security planning, OpenSSF/SLSA supply chain hygiene, and NIST AI RMF Responsible AI.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
go-table-tests
UnicoLab
Write Go tests the standard way — table-driven subtests, t.Helper, t.Cleanup, and what to assert instead of reflect.DeepEqual.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
conventional-commits
UnicoLab
Commit and PR messages that survive a `git log` six months later — Conventional Commits, imperative subjects, and what belongs in the body.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
api-versioning
UnicoLab
HTTP API design and evolution — resource shapes, status codes, pagination, and how to change an API without breaking its clients.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
openshift-manifests
UnicoLab
OpenShift deployment specs that pass the restricted SCC on the first apply — kustomize base/overlays, probes, limits, secrets done safely, and how to explain…
SkillAFreshness: A★ 1Claude Code +9
Cite this page
dockerfile-hygiene skill. Agent Mart. https://agentmart.dev/skills/unicolab-dockerfile-hygiene (last updated 2026-10-24)