Skip to main content
Manage Docker containers, images, volumes, and Compose.

Skill metadata

Reference: full SKILL.md

The following is the complete skill definition that Mibyan loads when this skill is triggered. This is what the agent sees as instructions when the skill is active.

Docker Management

Manage Docker containers, images, volumes, networks, and Compose stacks using standard Docker CLI commands. No additional dependencies beyond Docker itself.

When to Use

  • Run, stop, restart, remove, or inspect containers
  • Build, pull, push, tag, or clean up Docker images
  • Work with Docker Compose (multi-service stacks)
  • Manage volumes or networks
  • Debug a crashing container or analyze logs
  • Check Docker disk usage or free up space
  • Review or optimize a Dockerfile

Prerequisites

  • Docker Engine installed and running
  • User added to the docker group (or use sudo)
  • Docker Compose v2 (included with modern Docker installations)
Quick check:

Quick Reference

Procedure

1. Identify the domain

Figure out which area the request falls into:
  • Container lifecycle → run, stop, start, restart, rm, pause/unpause
  • Container interaction → exec, cp, logs, inspect, stats
  • Image management → build, pull, push, tag, rmi, save/load
  • Docker Compose → up, down, ps, logs, exec, build, config
  • Volumes & networks → create, inspect, rm, prune, connect
  • Troubleshooting → log analysis, exit codes, resource issues

2. Container operations

Run a new container:
Key flags: -d detached, -it interactive+tty, --rm auto-remove, -p port (host:container), -e env var, -v volume, --name name, --restart restart policy. Manage running containers:
Interact with containers:

3. Image management

4. Docker Compose

Minimal compose.yml example:

5. Volumes and networks

6. Disk usage and cleanup

Always start with a diagnostic before cleaning:
Warning: Never run docker system prune -a --volumes without confirming with the user. This removes named volumes with potentially important data.

Pitfalls

Verification

After any Docker operation, verify the result:
  • Container started? → docker ps (check status is “Up”)
  • Logs clean? → docker logs --tail 20 NAME (no errors)
  • Port accessible? → curl -s http://localhost:PORT or docker port NAME
  • Image built? → docker images | grep TAG
  • Compose stack healthy? → docker compose ps (all services “running” or “healthy”)
  • Disk freed? → docker system df (compare before/after)

Dockerfile Optimization Tips

When reviewing or creating a Dockerfile, suggest these improvements:
  1. Multi-stage builds — separate build environment from runtime to reduce final image size
  2. Layer ordering — put dependencies before source code so changes don’t invalidate cached layers
  3. Combine RUN commands — fewer layers, smaller image
  4. Use .dockerignore — exclude node_modules, .git, __pycache__, etc.
  5. Pin base image versions — node:20-alpine not node:latest
  6. Run as non-root — add USER instruction for security
  7. Use slim/alpine bases — python:3.12-slim not python:3.12