containerization
Skill4 starsChanged 4 months agoMITView on GitHub
Packages an application into a container image that is small, reproducible, and safe to run — Dockerfiles, layer caching, multi-stage builds, and runtime configuration. Use this whenever the user is writing a Dockerfile, mentions Docker, container images, image size or build times, or is preparing an application to run in Kubernetes or a container platform. For linting an existing Dockerfile, use code-linting.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- novatic-cu/nova-skillstheir own version, first seen Sep 20, 2026
- bmaltais/skillstheir own version, first seen Sep 6, 2026
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
- mmondora/claude-skillstheir own version, first seen Feb 14, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- ffsshhttiikk/opencode-agents-skills★ 2same name
- bmaltais/skills★ 1same name
- mmondora/claude-skills★ 1same name
- novatic-cu/nova-skills★ 1same 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 repository61 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-deploymentSkill
- agent-designSkill
- agent-evaluationSkill
- agent-hardeningSkill
- agent-implementationSkill
- agent-observabilitySkill
- agent-scopingSkill
- api-designSkill
- code-templatingSkill
- dependency-upgradeSkill
- error-handlingSkill
- feature-implementationSkill
- project-scaffoldingSkill
- refactoringSkill
- data-analysisSkill
- data-migrationSkill
- data-modelingSkill
- sql-queriesSkill
- ci-pipelinesSkill
- deployment-strategiesSkill
- infrastructure-as-codeSkill
- debuggingSkill
- issue-investigationSkill
- issue-triageSkill
- log-analysisSkill
- network-troubleshootingSkill
- performance-profilingSkill
- api-documentationSkill
- commit-messagesSkill
- diagrammingSkill
- markdown-docsSkill
- plain-languageSkill
- pr-descriptionsSkill
- release-notesSkill
- browser-testingSkill
- integration-testingSkill
- load-testingSkill
- test-dataSkill
- test-driven-developmentSkill
- unit-testingSkill
- deep-researchSkill
- feed-digestSkill
- summarizationSkill
- accessibility-reviewSkill
- code-analysisSkill
- code-lintingSkill
- code-reviewSkill
- auth-designSkill
- dependency-auditSkill
- secrets-managementSkill
- security-analysisSkill
- threat-modelingSkill
- capacity-planningSkill
- disaster-recoverySkill
- incident-responseSkill
- monitoring-setupSkill
- root-cause-analysisSkill
- runbooksSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Use .dockerignore — without it, the build context includes .git, node_modules, and local artifacts, which is slow and can leak secrets into …
- Distinctive: line 82
Use a numeric UID as well as a name, some platforms require it to enforce non-root
- Very specific: line 83
Do not chown -R the whole application directory.
- Very specific: line 94
Never: put secrets in ARG, ENV, or a COPY'd file
- Distinctive: line 95
Use BuildKit secret mounts for build-time credentials
- Distinctive: line 105
Log to stdout and stderr: Not to files inside the container
“Common” is measured: kept by at least 6 in 10 of the 3 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
Containerization
A container image is a build artifact that should be identical everywhere it runs. Most Dockerfile problems come from treating it as a virtual machine — installing a shell's worth of tooling, running as root, and rebuilding the world on every code change.
Three properties to aim for: small, reproducible, and least-privileged.
1. Order layers by how often they change
Docker caches per layer and invalidates everything after the first change. Put the stable things first:
COPY package.json package-lock.json ./
RUN npm ci # cached until dependencies change
COPY . . # invalidated on every code change
RUN npm run buildCopying source before installing dependencies means a one-line change re-downloads everything. This single ordering change is usually the largest build-time win available.
Use .dockerignore — without it, the build context includes .git, node_modules, and local
artifacts, which is slow and can leak secrets into the image.
Done when: a code-only change does not reinstall dependencies.
2. Use multi-stage builds
Build tooling has no business in a runtime image. Compilers, dev dependencies, and test fixtures add size and attack surface.
FROM node:22-slim AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:22-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY --from=build /app/dist ./dist
USER node
CMD ["node", "dist/server.js"]For compiled languages the runtime stage can often be distroless or scratch — no shell, no
package manager, almost nothing to exploit.
Done when: the runtime image contains only what running requires.
3. Pin the base image
- A specific version tag, never
latest.latestmakes the build non-reproducible and means the image you tested is not the one you deploy - By digest for production — a tag can be repointed
- Prefer slim or distroless variants, which are smaller and carry far fewer CVEs
- Rebuild on a schedule to pick up base image patches. A pinned image is reproducible and gets stale; both are true and the answer is scheduled rebuilds, not floating tags
Done when: the base is pinned and there is a plan for patching it.
4. Do not run as root
The default is root, and it is the most common real finding in a container review.
RUN useradd --system --uid 10001 app
USER app- Use a numeric UID as well as a name, some platforms require it to enforce non-root
- Do not
chown -Rthe whole application directory; copy with the right ownership instead - The container should not need write access to its own code
- Drop capabilities and use a read-only root filesystem where the app allows it
Done when: the process runs as a non-root user with no write access it does not need.
5. Keep secrets out of the image
Layers are permanent. A secret added in one layer and deleted in the next is still in the image
and readable with docker history.
- Never put secrets in
ARG,ENV, or aCOPY'd file - Use BuildKit secret mounts for build-time credentials
- Inject runtime configuration as environment variables or mounted files, not baked in
- Scan images for embedded credentials before publishing
Done when: docker history reveals nothing sensitive.
6. Configure for the runtime
- Handle signals. The process must be PID 1 or have an init that forwards
SIGTERM, or the platform kills it hard on every deploy and in-flight requests are dropped - Log to stdout and stderr. Not to files inside the container
- Health endpoints: separate liveness from readiness. Readiness must actually check dependencies; liveness must not, or a slow database restarts your app
- Set resource limits and make sure the runtime respects them. JVMs and Node need explicit configuration to see container memory limits rather than the host's
- One process per container, and let the platform handle restarts
Done when: the container starts, reports ready accurately, and shuts down cleanly on
SIGTERM.
Report
State the final image size, the base image and how it is pinned, the user it runs as, and what the build stages separate. Note anything you could not remove from the runtime image and why — that is the remaining attack surface.
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.

