docker-build-optimized
Skill5 starsChanged 2 days agoMITView on GitHub
Trigger: Dockerfile, docker build, imagen pesada, build lento, multi-stage, .dockerignore, buildx cache. Build small, fast, well-cached images on Kiri with the multiarch builder.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- alvaroofernaandez/dotfilesword for word, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 1
- alvaroofernaandez/dotfiles★ 5100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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 repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- aval-architectureSkill
- aval-docsSkill
- aval-release-notesSkill
- aval-releaseSkill
- aval-testingSkill
- accessibilitySkill
- ai-sdk-5Skill
- architecture-evidenceSkill
- branch-prSkill
- chained-prSkill
- cognitive-doc-designSkill
- design-pipelineSkill
- design-refactorSkill
- docker-space-optimizerSkill
- herdrSkill
- issue-creation-proSkill
- kiri-dockerSkill
- kiri-healthSkill
- laws-of-uxSkill
- lightpanda-browserSkill
- mac-disk-cleanupSkill
- pdf-reportSkill
- plan-deckSkill
- prs-proSkill
- react-19Skill
- readme-guardianSkill
- readme-portalSkill
- repo-prepSkill
- skill-creatorSkill
- strict-tddSkill
- tailwind-4Skill
- typescriptSkill
- work-unit-commitsSkill
- zod-4Skill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Read Dockerfile, .dockerignore and the compose file BEFORE building or editing.
- Very specific: line 41
If build cache exceeds ~10 GB or / has < 20 GiB free, suggest docker-space-optimizer.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Activation Contract
Load when writing or reviewing a Dockerfile, .dockerignore, compose.yaml/docker-compose.yml, or when a build is slow, an image is large, or caching misbehaves.
Hard Rules
- Read
Dockerfile,.dockerignoreand the compose file BEFORE building or editing. - Build against the
kiricontext withBUILDX_BUILDER=multiarch(seekiri-docker). Never build deploy images on Kiri's ownkiribuilder: it can silently return ARM64 for--platform linux/amd64. - Pin base images to a version tag (e.g.
node:22.11-alpine,python:3.12-slim); neverlatest. - Show proposed Dockerfile changes as a diff and explain each; do not rewrite build files the user did not ask to change.
- Tag images consistently:
<app>:<git-short-sha>or<app>:localfor dev; never rely on implicitlatest.
Decision Gates
| Finding | Recommendation |
| Build toolchain ends up in final image | Multi-stage: build stage → minimal runtime stage |
No .dockerignore or it misses .git, node_modules, .venv, dist, .env* | Add/extend it |
COPY . . before dependency install | Copy lockfiles first, install, then copy source |
| Dependencies re-download every build | RUN --mount=type=cache,target=<pkg cache> |
| Full distro base for a static/interpreted app | -slim, -alpine or distroless — only if native deps allow |
Many RUN lines cleaning caches separately | Merge install + cleanup in one layer |
| amd64-only target | --platform linux/amd64 on the multiarch builder, then verify the architecture |
InvalidBaseImagePlatform warning | Wrong builder: echo $BUILDX_BUILDER must be multiarch |
Execution Steps
- Inspect the build files and the current image size (
docker image ls <app>). - Apply the approved recommendations from the table.
- Build:
docker buildx build --tag <app>:local --load .ordocker compose up -d --build(buildermultiarch,default-load=true). - For any image to push or deploy, verify:
docker image inspect -f '{{.Architecture}}' <image>must printamd64(or the intended arch). Do not push otherwise. - Report:
docker image ls,docker system df. - If build cache exceeds ~10 GB or
/has < 20 GiB free, suggestdocker-space-optimizer.
Output Contract
Return: changes applied (diff), build command, image size before/after, build time if measured, and docker system df summary.
References
../kiri-docker/SKILL.md— runtime rules.../docker-space-optimizer/SKILL.md— cache cleanup.
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.

