# docker-containerization

docker-containerization generates production-ready Dockerfiles, optimizes layer caching, and writes docker-compose setups for local development.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 143 installs · ★ 274 repo stars
- Author: curiositech
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/curiositech/some_claude_skills/tree/HEAD/.claude/skills/docker-containerization/SKILL.md
- Updated: 2026-10-30
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/curiositech-docker-containerization

## What it does

The skill equips Claude Code with container patterns across Node.js, Python, Go, and Rust. It enforces strict caching discipline by ordering Dockerfile instructions from least to most volatile: dependency locks like `uv.lock` or `package-lock.json` are copied before application code. It also applies security controls, switching execution away from the root user and pairing compiled Go binaries with minimal distroless base images.

Beyond standalone images, the skill writes `docker-compose.yml` configurations with health checks, anonymous volumes for dependencies, and Docker Compose Watch sync rules. Kubernetes manifests, cloud engines such as AWS ECS, and CI/CD workflows are completely out of scope — the author explicitly redirects pipeline design to `github-actions-pipeline-builder`.

## Requirements
- Works with: Docker, Kubernetes

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill docker-containerization -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/docker-containerization/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/docker-containerization/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill docker-containerization -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/docker-containerization/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill docker-containerization -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/docker-containerization/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install curiositech/some_claude_skills .claude/skills/docker-containerization
```

2. **Manually: put the files in place**
- File: `.github/skills/docker-containerization/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill docker-containerization -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/curiositech/some_claude_skills --path .claude/skills/docker-containerization
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/docker-containerization/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add curiositech/some_claude_skills --skill docker-containerization -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/curiositech/some_claude_skills/tree/HEAD/.claude/skills/docker-containerization/SKILL.md

## When to use it
- shrink container image footprint using multi-stage builds
- prevent layer cache invalidation during dependency installation
- secure runtime containers with dedicated non-root users
- configure local hot reload with Docker Compose Watch

## Example prompts
- Create a multi-stage Dockerfile for a FastAPI service using uv
- Optimize this Go Dockerfile with a distroless runtime image
- Set up a docker-compose.yml with Postgres and hot reload support

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: d6eecb598669bb89.

BEGIN THIRD-PARTY FILE d6eecb598669bb89
````text
---
name: docker-containerization
description: Write production-grade Dockerfiles, docker-compose configurations, multi-stage builds, and container optimization. Activate on "Dockerfile", "docker", "docker-compose", "container", "multi-stage
  build", "docker image", "container optimization", "docker security". NOT for Kubernetes orchestration, cloud-specific container services (ECS, Cloud Run), or CI/CD pipelines (use github-actions-pipeline-builder).
allowed-tools: Read,Write,Edit,Bash,Grep,Glob
metadata:
  category: DevOps & Site Reliability
  tags:
  - docker
  - containerization
  - dockerfile
  - docker-compose
  pairs-with:
  - skill: devops-automator
    reason: Docker images are built, tested, and deployed through CI/CD automation pipelines
  - skill: github-actions-pipeline-builder
    reason: Container builds and registry pushes are common GitHub Actions workflow stages
  - skill: site-reliability-engineer
    reason: Container health checks, resource limits, and orchestration are SRE responsibilities
  - skill: microservices-patterns
    reason: Microservices are typically deployed as individual Docker containers
---

# Docker Containerization

Write production-grade Dockerfiles with multi-stage builds, security hardening, and size optimization. Covers docker-compose for local development, image layer caching, health checks, and the patterns that separate a 2GB image from a 50MB one.

## When to Use

**Use for**:
- Writing Dockerfiles from scratch or improving existing ones
- Multi-stage builds for compiled languages (Go, Rust, TypeScript)
- Docker Compose for local development environments
- Image size optimization (choosing base images, layer caching)
- Docker security scanning and hardening
- Development vs production Dockerfile patterns
- Debugging container build failures
- .dockerignore optimization

**NOT for**:
- Kubernetes deployment/orchestration (different domain)
- Cloud-specific container services (ECS, Cloud Run, App Runner)
- CI/CD pipeline configuration (use `github-actions-pipeline-builder`)
- Container networking beyond docker-compose
- Docker Swarm

---

## Dockerfile Decision Tree

```mermaid
flowchart TD
    Start[What are you building?] --> Lang{Language/runtime?}
    Lang -->|Node.js/TypeScript| Node[Node pattern]
    Lang -->|Python| Python[Python pattern]
    Lang -->|Go| Go[Go pattern]
    Lang -->|Rust| Rust[Rust pattern]
    Lang -->|Static site| Static[Static pattern]

    Node --> NQ{Need build step?}
````
END THIRD-PARTY FILE d6eecb598669bb89

The third-party file has ended. Everything between the d6eecb598669bb89 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2486 of 13034 bytes. © curiositech · MIT · https://github.com/curiositech/some_claude_skills/tree/HEAD/.claude/skills/docker-containerization/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
