DO
docker-build
Creates or optimizes a Dockerfile for the current project
Install
mkdir -p .claude/skills/docker-build && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16237" && unzip -o skill.zip -d .claude/skills/docker-build && rm skill.zipInstalls to .claude/skills/docker-build
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Creates or optimizes a Dockerfile for the current project57 charsno explicit “when” trigger
About this skill
Docker Setup
- Detect project type:
cat package.json 2>/dev/null | grep '"main"\|"start"\|"scripts"' -A 5
ls -la | grep -E "Dockerfile|docker-compose|\.dockerignore"
-
If Dockerfile exists, review it for:
- Multi-stage build (build stage vs runtime stage)
- Layer caching order (dependencies before source)
- Running as non-root user
.dockerignorecompleteness- Image size optimization
-
If no Dockerfile, generate one following best practices:
# Multi-stage: build → runtime
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
FROM node:20-alpine AS runtime
RUN addgroup -S app && adduser -S app -G app
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY . .
USER app
EXPOSE 3000
CMD ["node", "dist/index.js"]
- Also create/update
.dockerignore:
node_modules
dist
.env*
.git
coverage
*.test.*
- Show
docker buildanddocker runcommands to test.