docker-containerization · aj-geddes — Claude Code skill for Dockerfiles and image optimization
docker-containerization — a skill that pushes agents toward production-grade Docker builds: multi-stage Dockerfiles, non-root users, smaller images. Use it when an app needs containerizing or an existing Dockerfile needs cleanup.
MIT 683 installs ★ 386 updated 2026-03-04
npx skills add aj-geddes/useful-ai-prompts --skill docker-containerization -a claude-codeWhat docker-containerization does
The skill sets rules for the agent whenever Docker work comes up. Multi-stage builds, pinned base image versions, a non-root user in the final stage, .dockerignore, health checks. The repository also carries reference guides on multi-stage builds, optimization, security, and Docker Compose.
Separate guides exist for Python (Django/Flask), Java (Spring Boot), and Go. The README includes a full multi-stage Dockerfile for Node.js with npm ci --only=production, a non-root nodejs user, and EXPOSE 3000. Useful as a starting point, not as a copy-paste for every project.
Installation runs through npx, so Node.js is required. In Claude Code the skill lands at ~/.claude/skills/docker-containerization/SKILL.md.
What it helps with
- write a Dockerfile with a multi-stage build
- cut down production image size
- run the container as a non-root user
- set up Docker Compose for multiple services
- keep secrets out of the image
Example prompts for the agent
- Write a Dockerfile for this Node.js app using the docker-containerization skill
- This image is too large, optimize it
- Check my Dockerfile for security problems and fix them
How to install docker-containerization
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill docker-containerization -a claude-code2Manually: put the files in place
~/.claude/skills/docker-containerization/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/docker-containerization/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill docker-containerization -a codex2Manually: put the files in place
.agents/skills/docker-containerization/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill docker-containerization -a cursor2Manually: put the files in place
.cursor/skills/docker-containerization/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts skills/docker-containerization2Manually: put the files in place
.github/skills/docker-containerization/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill docker-containerization -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/docker-containerizationManually: put the files in place
.devin/skills/docker-containerization/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill docker-containerization -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about docker-containerization
How do I install docker-containerization in Claude Code?
Run npx skills add aj-geddes/useful-ai-prompts --skill docker-containerization -a claude-code. The skill ends up at ~/.claude/skills/docker-containerization/SKILL.md.
What does docker-containerization do?
It gives the agent a set of Docker practices: multi-stage builds, non-root users, .dockerignore, health checks, minimal layers. Reference guides cover Python, Go, Spring Boot, and Docker Compose.
Which stacks does the skill cover?
There are dedicated guides for Python (Django/Flask), Java (Spring Boot), and Go. The README shows a Node.js multi-stage example with a non-root user.
Source text
SKILL.md · MIT
--- name: docker-containerization description: > Create optimized Docker containers with multi-stage builds, security best practices, and minimal image sizes. Use when containerizing applications, creating Dockerfiles, optimizing container images, or setting up Docker Compose services. --- # Docker Containerization ## Table of Contents - [Overview](#overview) - [When to Use](#when-to-use) - [Quick Start](#quick-start) - [Reference Guides](#reference-guides) - [Best Practices](#best-practices) ## Overview Build production-ready Docker containers following best practices for security, performance, and maintainability. ## When to Use - Containerizing applications for deployment - Creating Dockerfiles for new services - Optimizing existing container images - Setting up development environments - Building CI/CD container pipelines - Implementing microservices ## Quick Start Minimal working example: ```dockerfile # Multi-stage build for Node.js application # Stage 1: Build FROM node:18-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY . . RUN npm run build # Stage 2: Production FROM node:18-alpine WORKDIR /app # Copy only production dependencies and built files COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/dist ./dist COPY package*.json ./ # Security: Run as non-root user RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001 USER nodejs EXPOSE 3000 CMD ["node", "dist/index.js"] ``` ## Reference Guides Detailed implementations in the `references/` directory: | Guide | Contents | |---|---| | [Multi-Stage Builds](references/multi-stage-builds.md) | Multi-Stage Builds | | [Optimization Techniques](references/optimization-techniques.md) | Optimization Techniques | | [Security Best Practices](references/security-best-practices.md) | Security Best Practices, Environment Configuration | | [Docker Compose for Multi-Container](references/docker-compose-for-multi-container.md) | Docker Compose for Multi-Container | | [.dockerignore File](references/dockerignore-file.md) | .dockerignore File | | [Python](references/python.md) | Python (Django/Flask), Java (Spring Boot), Go | ## Best Practices ### ✅ DO - Use official base images - Implement multi-stage builds - Run as non-root user - Use .dockerignore - Pin specific versions - Include health checks - Scan for vulnerabilities - Minimize layers - Use build caching effectively ### ❌ DON'T - Use 'latest' tag in production - Run as root user - Include secrets in images - Create unnecessary layers - Install unnecessary packages - Ignore security updates - Store data in containers
© aj-geddes · MIT · aj-geddes/useful-ai-prompts
Similar skills
All skills for DevOps and infrastructure →docker-containerization by other authors comes first.