# docker-expert

The skill guides Claude Code in refining Dockerfiles, slimming down container images, and enforcing security practices.

- skill · `type=skill` · Claude Code · 2449 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/docker-expert
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/docker-expert

## What it does

The skill inspects local repositories for `Dockerfile`, Compose files, and `.dockerignore` configs. It prefers native file tools such as Read and Grep, falling back to shell checks like `docker info`. During multi-stage setup, it isolates dependency downloads from application source code so that Docker caches build steps properly.

Hardening rules receive heavy focus. The assistant defines non-root users with explicit UID and GID pairs, adds `healthcheck` declarations, and swaps plain environment variables for Docker secrets. Whenever a request steers into Kubernetes manifests, CI workflows, or cloud infrastructure, the skill halts and points to an appropriate subagent.

Post-build checks verify configuration changes with commands like `docker build --no-cache` and `docker-compose config`. Without a working Docker engine on the host, these runtime validation checks fail silently or return terminal warnings.

## Requirements
- Works with: Docker

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill development/docker-expert
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill docker-expert -a claude-code
```

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

### Codex

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

### Cursor

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates docker-expert
```

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

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/docker-expert
```

### Windsurf (Devin Desktop)

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

### 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/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/docker-expert

## When to use it
- Cut final image sizes using multi-stage builds and minimal base images
- Harden container permissions by creating dedicated non-root users
- Configure service health checks and dependency order inside docker-compose.yml
- Protect database credentials with Docker secrets instead of plain environment variables

## Example prompts
- Rewrite this Dockerfile as a multi-stage build to minimize image size
- Secure the container runtime by adding a non-root user and health checks
- Set up a docker-compose.yml configuration with isolated networks and secret mounts

## Similar
- [docker-patterns](https://affpapa.org/en/nevibecode/skills/docker-patterns.md) — skill · 6400 installs
- [docker](https://affpapa.org/en/nevibecode/skills/mindrally-docker.md) — skill · 1100 installs
- [docker-compose-production](https://affpapa.org/en/nevibecode/skills/docker-compose-production.md) — skill · 484 installs
- [Docker Configuration Validator](https://affpapa.org/en/nevibecode/skills/docker-configuration-validator.md) — skill · 336 installs
- [containerization-docker-best-practices](https://affpapa.org/en/nevibecode/rules/containerization-docker-best-practices.md) — rule · ★ 40451
- [docker-development](https://affpapa.org/en/nevibecode/plugins/docker-development.md) — plugin · ★ 28786

## Other versions with the same name
- [docker-expert · sickn33](https://affpapa.org/en/nevibecode/skills/sickn33-docker-expert.md) — 27300 installs
- [docker-expert · personamanagmentlayer](https://affpapa.org/en/nevibecode/skills/pcl-team-docker-expert.md) — 365 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 361 cards

---
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
