Docker
by @ivangdavila
Docker containers, images, Compose stacks, networking, volumes, debugging, production hardening, and the commands that keep real environments stable. Use whe...
clawhub install dockerπ About This Skill
name: Docker slug: docker version: 1.0.4 homepage: https://clawic.com/skills/docker description: "Docker containers, images, Compose stacks, networking, volumes, debugging, production hardening, and the commands that keep real environments stable. Use when (1) the task touches Docker, Dockerfiles, images, containers, or Compose; (2) build reliability, runtime behavior, logs, ports, volumes, or security matter; (3) the agent needs Docker guidance and should apply it by default." changelog: Simplified the skill name and kept the stateless activation guidance metadata: {"clawdbot":{"emoji":"π³","requires":{"bins":["docker"]},"os":["linux","darwin","win32"]}}
When to Use
Use when the task involves Docker, Dockerfiles, container builds, Compose, image publishing, networking, volumes, logs, debugging, or production container operations. This skill is stateless and should be applied directly whenever Docker work appears.
Quick Reference
| Topic | File |
|-------|------|
| Essential commands | commands.md |
| Dockerfile patterns | images.md |
| Compose orchestration | compose.md |
| Networking & volumes | infrastructure.md |
| Security hardening | security.md |
Core Rules
1. Pin Image Versions
python:3.11.5-slim not python:latest2. Combine RUN Commands
apt-get update && apt-get install -y pkg in ONE layer3. Non-Root by Default
USER nonroot in Dockerfile4. Set Resource Limits
-m 512m on every container5. Configure Log Rotation
Image Traps
--from=builder copies from wrong stage silentlyADD extracts archives automatically β use COPY unless you need extractionRuntime Traps
localhost inside container is container's localhost β bind to 0.0.0.0docker inspect --format='{{.State.ExitCode}}'docker cp files out or use debug sidecarNetworking Traps
0.0.0.0 β use 127.0.0.1:5432:5432 for local-onlyCompose Traps
depends_on waits for container start, not service ready β use condition: service_healthy.env file in wrong directory silently ignored β must be next to docker-compose.ymlVolume Traps
docker system prune doesn't remove named volumes β add --volumes flagResource Leaks
docker image prune regularlydocker builder prune reclaims spacedocker container prune or --rm on rundocker network pruneSecrets and Security
--privileged disables all security β almost never needed, find specific capability insteadDebugging
docker inspect --format='{{.State.ExitCode}}'docker logs docker cp files out or use debug sidecardocker cp deadcontainer:/path ./localRelated Skills
Install withclawhub install if user confirms:
devops β deployment pipelineslinux β host system managementserver β server administrationFeedback
clawhub star dockerclawhub syncβ‘ When to Use
Use when the task involves Docker, Dockerfiles, container builds, Compose, image publishing, networking, volumes, logs, debugging, or production container operations. This skill is stateless and should be applied directly whenever Docker work appears.