Claude Code Plugins

Community-maintained marketplace

Feedback

Docker and containerization best practices including multi-stage builds, security, and Docker Compose.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name docker
description Docker and containerization best practices including multi-stage builds, security, and Docker Compose.
globs **/Dockerfile, **/docker-compose.yml, **/docker-compose.yaml, **/.dockerignore
priority 80
tags devops

Docker Best Practices

Dockerfile

  • Use specific base image tags (not :latest)
  • Use multi-stage builds for smaller images
  • Minimize layers (combine RUN commands)
  • Copy package.json first for caching
  • Run as non-root user
  • Use .dockerignore

Example Multi-stage Build

FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:20-alpine AS runner
WORKDIR /app
RUN addgroup -g 1001 nodejs
RUN adduser -S nodejs -u 1001
COPY --from=builder /app/dist ./dist
USER nodejs
CMD ["node", "dist/index.js"]

Docker Compose

  • Use version 3.8+
  • Define healthchecks
  • Use named volumes for persistence
  • Configure restart policies
  • Use environment files

Security

  • Scan images for vulnerabilities
  • Don't run as root
  • Use secrets for sensitive data
  • Keep base images updated
  • Use distroless/alpine images

Performance

  • Use BuildKit
  • Leverage layer caching
  • Use .dockerignore
  • Minimize image size