dockerfile-best-practices skillA
dockerfile-best-practices is agent-read markdown (skill) from khaledsaeed18/dotclaude: Write or review a Dockerfile and compose setup for a production service: multi-stage builds that ship only the runtime, pinned base images, layer order for cache hits, non-root user, minimal image size, correct signal handling and health checks, secrets kept out of layers, and language-specific patterns for Node, Python, Go, and Java. Use when containerising a service, when images are large or slow to build, when a container ignores SIGTERM, or when a security scan flags the image..
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
A production image contains exactly what the process needs to run, built reproducibly, running as a non-root user, and stopping cleanly when asked. Everything below follows from those four properties. ## Structure: multi-stage ```dockerfile # syntax=docker/dockerfile:1.7 FROM node:22.11-bookworm-slim AS deps WORKDIR /app COPY package.json pnpm-lock.yaml ./ RUN corepack enable && pnpm install --frozen-lockfile --prod=false FROM deps AS build COPY . . RUN pnpm build && pnpm prune --prod FROM node:22.11-bookworm-slim AS runtime ENV NODE_ENV=production WORKDIR /app RUN groupadd -r app && useradd -r -g app -d /app app COPY --from=build --chown=app:app /app/node_modules ./node_modules COPY --from=build --chown=app:app /app/dist ./dist COPY --chown=app:app package.json ./ USER app EXPOSE 3000 HEALTHCHECK --interval=30s --timeout=3s --start-period=10s CMD node dist/healthcheck.js ENTRYPOINT ["node", "dist/server.js"] ``` Build stages hold compilers and dev dependencies; the runtime stage copies artifacts only. ## Rules **Base images** …
Read the whole file at its exact version.
How to install
mdr add khaledsaeed18/dotclaude/dockerfile-best-practices@git:20260921.8d3f9ebmdr add khaledsaeed18/dotclaude/dockerfile-best-practices@sha256:d7a07860e9927f06Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
[](https://markdownregistry.com/a/art_ikaab322mxt76skq)
1 badge views in 30 days
Versions
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (5669 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
khaledsaeed18/dotclaude · 5 stars · license MIT · pushed 2026-09-22 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_ikaab322mxt76skq GET https://markdownregistry.com/api/v1/resolve?ref=khaledsaeed18/dotclaude/dockerfile-best-practices GET https://markdownregistry.com/api/v1/blob/d7a07860e9927f06341e932cd33b348a005a8f76ea2c5a3fec94dfa64f3c5bbd
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.