dockerfile
Skill2 starsChanged 3 months agoMITView on GitHub
Create, review, or update Dockerfiles and container build workflows. Use for containerizing projects, designing multi-stage builds, choosing scratch vs Alpine final images, enforcing non-root UID/GID ownership, running build/test steps in Docker, and keeping GitHub Actions workflows thin by making the Dockerfile the local CI source of truth.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- petr-korobeinikov/skillstheir own version, first seen Jun 28, 2026
- Cogni-AI-OU/cogni-ai-agent-skillstheir own version, first seen May 19, 2026
- brpaz/agent-skillstheir own version, first seen May 17, 2026
- mohitkale/docker-kubernetestheir own version, first seen Apr 18, 2026
- zeon-kun/claude-skillstheir own version, first seen Apr 7, 2026
- CorentinGC/claude-skillstheir own version, first seen Mar 7, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- zeon-kun/claude-skills★ 6same name
- Cogni-AI-OU/cogni-ai-agent-skills★ 4same name
- brpaz/agent-skills★ 1same name
- petr-korobeinikov/skills★ 1same name
- CorentinGC/claude-skills★ 0same name
- mohitkale/docker-kubernetes★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- act-within-scopeSkill
- asd-ste100Skill
- codingSkill
- context-managementSkill
- create-verification-skillSkill
- domain-modelingSkill
- encode-lessonsSkill
- experience-firstSkill
- eyes-onSkill
- flux-ghcr-image-automationSkill
- flux-kustomize-layoutSkill
- frontend-designSkill
- git-commit-workflowSkill
- git-worktreeSkill
- grill-with-docsSkill
- implement-ticketsSkill
- maintain-verification-skillSkill
- makefileSkill
- omarchy-developmentSkill
- releaseSkill
- skill-evaluationSkill
- technical-writingSkill
- test-auditSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 8 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Create Dockerfiles that are secure, reproducible, and useful as the canonical local CI build.
- Very specific: line 22
If the output is a single static binary, aim for a scratch final image.
- Very specific: line 23
If the output needs an interpreter, shared libraries, package files, or runtime dependencies, aim for an Alpine final image such as …
- Distinctive: line 26
If Alpine is incompatible with required native dependencies, explain why and choose the smallest appropriate runtime base.
- Distinctive: line 28
Keep build tools, test tools, package managers, and source code out of the final image unless they are required at runtime.
- Very specific: line 33
Add ARG UID=10001 and ARG GID=10001 in every stage that creates or owns files used by the runtime image.
- Very specific: line 35
Run the final container as non-root with USER ${UID}:${GID} or a named user created from those args.
- Very specific: line 37
Ensure every file used by the final executable is owned by the runtime UID/GID.
- Very specific: line 38
Prefer COPY --chown=${UID}:${GID} for final-stage copies.
- Very specific: line 45
Use exec-form ENTRYPOINT or CMD.
- Distinctive: line 49
Use a dedicated build stage for compilation, dependency installation, and generated artifacts.
- Very specific: line 51
Add a test stage when the project has a clear test command.
- Very specific: line 58
Keep the Dockerfile sufficient for local CI verification so GitHub Actions can usually be a simple docker build plus optional image push.
- Distinctive: line 60
Use BuildKit cache mounts when they improve repeat builds and the project already assumes BuildKit.
- Very specific: line 69
Write a .dockerignore if missing or incomplete.
- Distinctive: line 71
Ensure final-stage ownership, non-root user, and minimal copied files.
- Distinctive: line 72
If asked for CI, make the workflow invoke the Dockerfile rather than duplicating build logic.
- Distinctive: line 79
Read references/patterns.md when writing concrete Dockerfile examples or adapting this policy to Go, Rust, Python, Node, or a plain Alpine …
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dockerfile
Goal
Create Dockerfiles that are secure, reproducible, and useful as the canonical local CI build. Prefer multi-stage builds unless the user explicitly asks for a single-stage file.
Decision Order
- Identify the final runtime artifact.
- If the output is a single static binary, aim for a
scratchfinal image. - If the output needs an interpreter, shared libraries, package files, or
runtime dependencies, aim for an Alpine final image such as
python:<version>-alpine,node:<version>-alpine, or plainalpine. - If Alpine is incompatible with required native dependencies, explain why and choose the smallest appropriate runtime base.
- Keep build tools, test tools, package managers, and source code out of the final image unless they are required at runtime.
Required Container Policy
- Add
ARG UID=10001andARG GID=10001in every stage that creates or owns files used by the runtime image. - Run the final container as non-root with
USER ${UID}:${GID}or a named user created from those args. - Ensure every file used by the final executable is owned by the runtime UID/GID.
Prefer
COPY --chown=${UID}:${GID}for final-stage copies. - For
scratch, use numericUSER ${UID}:${GID}and copy only required files: the static binary, CA certificates when outbound TLS is needed, and any minimal config/data files the binary actually reads. - For Alpine runtime images, create the user/group from
UIDandGID, then copy application files with that owner. - Set a narrow
WORKDIR; do not run from filesystem root. - Use exec-form
ENTRYPOINTorCMD.
Build And Test Pattern
- Use a dedicated build stage for compilation, dependency installation, and generated artifacts.
- Add a test stage when the project has a clear test command. Examples:
go test ./...,cargo test --locked,npm test,pytest. Skip tests that need cluster or network from a container build. Keep cluster tools such askubectlout of the final image. - Make the default Docker build exercise tests when practical by having the
production stage depend on the tested artifact path, or document:
docker build --target test .. - Keep the Dockerfile sufficient for local CI verification so GitHub Actions can
usually be a simple
docker buildplus optional image push. - Use BuildKit cache mounts when they improve repeat builds and the project already assumes BuildKit.
Workflow
- Inspect the project manifest and lock files before writing the Dockerfile.
- Determine whether the runtime is a static binary, dynamic binary, or dynamic language/runtime app.
- Choose the final image using the decision order above.
- Write a
.dockerignoreif missing or incomplete. - Include test and build stages that match the project tooling.
- Ensure final-stage ownership, non-root user, and minimal copied files.
- If asked for CI, make the workflow invoke the Dockerfile rather than duplicating build logic.
- Validate with
docker buildwhen Docker is available; otherwise report that validation was not run.
Pattern Reference
Read references/patterns.md when writing concrete Dockerfile examples or adapting this policy to Go, Rust, Python, Node, or a plain Alpine runtime.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

