docker-management

Docker container and image management including logs, stats, and compose operations. Use when managing Docker containers, debugging container issues, or working with Docker Compose.

allowed_tools: Bash, Read, Write

$ Instalar

git clone https://github.com/ShunsukeHayashi/miyabi-mcp-bundle /tmp/miyabi-mcp-bundle && cp -r /tmp/miyabi-mcp-bundle/.claude/skills/docker-management ~/.claude/skills/miyabi-mcp-bundle

// tip: Run this command in your terminal to install the skill


name: docker-management description: Docker container and image management including logs, stats, and compose operations. Use when managing Docker containers, debugging container issues, or working with Docker Compose. allowed-tools: Bash, Read, Write mcp_tools:

  • "docker_ps"
  • "docker_images"
  • "docker_logs"
  • "docker_inspect"
  • "docker_stats"
  • "docker_exec"
  • "docker_start"
  • "docker_stop"
  • "docker_restart"
  • "docker_rm"
  • "compose_ps"
  • "compose_logs"
  • "compose_up"
  • "compose_down"

Docker Management Skill

Version: 1.0.0 Purpose: Docker container and compose management


Triggers

TriggerExamples
Containers"list containers", "docker ps", "コンテナ一覧"
Logs"container logs", "docker logs", "ログ確認"
Debug"debug container", "container issue", "デバッグ"
Compose"compose up", "compose status", "Compose起動"

Integrated MCP Tools

Container Operations

ToolPurpose
docker_psList containers (running/all)
docker_imagesList local images
docker_logsContainer logs (tail, follow)
docker_inspectContainer details (JSON)
docker_statsResource usage (CPU, memory)
docker_execExecute command in container
docker_startStart stopped container
docker_stopStop running container
docker_restartRestart container
docker_rmRemove container

Compose Operations

ToolPurpose
compose_psCompose project status
compose_logsService logs
compose_upStart services
compose_downStop and remove services

Workflow: Container Debugging

Phase 1: Assessment

Step 1.1: List Containers

Use docker_ps with:
- all: true (include stopped)

Step 1.2: Check Status

Look for:

  • Exit codes
  • Restart counts
  • Health status

Phase 2: Investigation

Step 2.1: View Logs

Use docker_logs with:
- container: Container name/ID
- tail: 100 (last N lines)
- timestamps: true

Step 2.2: Inspect Configuration

Use docker_inspect to check:
- Environment variables
- Mount points
- Network settings
- Health check config

Step 2.3: Resource Usage

Use docker_stats to monitor:
- CPU percentage
- Memory usage
- Network I/O
- Block I/O

Phase 3: Resolution

Step 3.1: Restart Container

Use docker_restart for temporary fix

Step 3.2: Execute Commands

Use docker_exec to run diagnostics inside container:
- command: "sh -c 'ps aux'"
- command: "cat /var/log/app.log"

Workflow: Docker Compose

Step 1: Check Status

Use compose_ps to see all services

Step 2: View Logs

Use compose_logs with:
- service: Specific service name
- tail: 50

Step 3: Service Management

Use compose_up to start services
Use compose_down to stop and clean up

Common Issues

SymptomToolAction
Container exitsdocker_logsCheck error messages
High memorydocker_statsIdentify memory leak
Network issuesdocker_inspectVerify network config
Mount failuresdocker_inspectCheck volume mounts

Best Practices

✅ GOOD:

  • Check logs before restarting
  • Use health checks
  • Set resource limits
  • Use named volumes

❌ BAD:

  • Restart without investigation
  • Run as root unnecessarily
  • Store secrets in images
  • Use latest tag in production

Checklist

  • Docker daemon running
  • Container status checked
  • Logs reviewed
  • Resource usage normal
  • Network connectivity OK