docker
Originally frombobmatnyc/claude-mpm-skills
SKILL.md
Docker Code Review Rules
Base Images
- Pin base image to specific version (not
latest) - Use official images from trusted sources
- Prefer minimal images (
alpine,slim,distroless) - Regularly update base images for security patches
Build Optimization
- Use multi-stage builds to reduce final image size
- Order instructions by change frequency (cache optimization)
- Combine
RUNcommands to reduce layers - Use
.dockerignoreto exclude unnecessary files
Security
- Run as non-root user (
USERdirective) - Don't store secrets in image (use runtime injection)
- Don't use
--privilegedwithout justification - Scan images for vulnerabilities
- Set
readonlyroot filesystem where possible
Health Checks
- Include
HEALTHCHECKinstruction - Health check should verify app is actually working
- Set appropriate interval and timeout
Instructions
- Use
COPYinstead ofADD(unless extracting archives) - Set
WORKDIRbeforeCOPY/RUN - Use explicit
EXPOSEfor documentation - Set meaningful
LABELmetadata
Example Good Dockerfile Pattern
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
# Runtime stage
FROM node:20-alpine
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /app
COPY /app/node_modules ./node_modules
COPY . .
USER appuser
EXPOSE 3000
HEALTHCHECK CMD wget -q --spider http://localhost:3000/health || exit 1
CMD ["node", "server.js"]
Weekly Installs
3
Repository
yldgio/anomalycoFirst Seen
Jan 29, 2026
Security Audits
Installed on
opencode3
mcpjam2
kiro-cli2
antigravity2
codebuddy2
windsurf2