Dockerfile author
Write a secure, small, well-layered Dockerfile for an application. Use when the user asks to containerize an app, write or optimize a Dockerfile, or fix image size/build issues.From its SKILL.md
npx -y skills add minagayid/Agents --skill dockerfile-authorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.5 KB, as published. Nobody here has run it
Dockerfile Author
Produce Dockerfiles that are small, cacheable, and secure.
Steps
- Identify the language/runtime, build steps, and the runtime entrypoint.
- Use a multi-stage build: compile/install in a build stage, copy only artifacts to a slim runtime stage.
- Pin a specific minimal base image (e.g.
python:3.12-slim,node:22-alpine,gcr.io/distroless/*). - Order layers for cache: copy dependency manifests and install before copying source.
- Run as a non-root user; set
WORKDIR,EXPOSE, and a healthcheck where relevant. - Add a
.dockerignore(.git,node_modules, build caches, secrets).
Example (Node)
# --- build ---
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# --- runtime ---
FROM node:22-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
COPY --from=build /app/dist ./dist
USER node
EXPOSE 3000
CMD ["node", "dist/index.js"]
Guidelines
- Never bake secrets into layers; pass them at runtime or via build secrets.
- Combine related
RUNsteps and clean package caches in the same layer. - Prefer
COPYoverADD; prefer exec-formCMD/ENTRYPOINT(["..."]). - Verify with
docker buildand check final size withdocker images.