docker-ops

Docker container lifecycle management, health checks, log analysis, cleanup, compose orchestration, and troubleshooting. Use when Codex needs to manage Docker containers, debug running services, inspect logs, clean up resources, or orchestrate multi-service setups with Docker Compose.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "docker-ops" with this command: npx skills add ericlooi504/docker-ops-toolkit

Docker Ops

Overview

Docker container lifecycle management, health checks, log analysis, cleanup, compose orchestration, and troubleshooting. Use when Codex needs to manage Docker containers, debug running services, or clean up Docker resources.

Quick Start

Prerequisites

  • Docker Engine (docker CLI)
  • docker compose plugin (for compose)

Check what's running

docker ps -a --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}\t{{.Image}}'
docker stats --no-stream                   # live resource usage

Inspect a container

docker inspect <container> | jq '.[0].State'   # status, exit code, health
docker inspect <container> --format '{{json .Mounts}}' | jq .

Logs analysis

docker logs <container> --tail 100 --since 5m
# Use docker-log-inspector.py for filtering:
python3 scripts/docker-log-inspector.py <container> --since 30m --filter ERROR --summary

Clean up unused resources

# Standard cleanup
bash scripts/docker-cleanup.sh
# Aggressive cleanup (removes volumes + build cache)
bash scripts/docker-cleanup.sh --aggressive
# Preview only
bash scripts/docker-cleanup.sh --dry-run

Health check

bash scripts/docker-health.sh                     # all containers
bash scripts/docker-health.sh <container-name>    # single container

Common Tasks

Docker Compose workflows

docker compose up -d                      # start services
docker compose down -v                    # stop + remove volumes
docker compose logs -f --tail 50          # follow logs
docker compose ps                         # status
docker compose exec <service> sh          # shell into a service
docker compose build --no-cache <svc>     # rebuild without cache
docker compose restart <service>          # restart one service

Port conflicts

# Find what's using a port
sudo lsof -i :<port>
docker ps --format '{{.Names}} {{.Ports}}' | grep <port>
# Fix: change port mapping in docker-compose.yml or stop conflicting container

Resource limits and OOM

docker inspect <container> --format '{{json .HostConfig.Memory}}'
docker stats <container> --no-stream
# Fix: add to docker-compose.yml
#   deploy:
#     resources:
#       limits:
#         memory: 512M
#         cpus: '0.5'

Image management

docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.CreatedSince}}'
docker image prune -a                    # remove all unused images
docker rmi <image-id>                    # remove specific image
docker pull <image>:<tag>                # update image
docker build -t <name>:<tag> .           # build
docker build --no-cache -t <name> .      # force rebuild

Network troubleshooting

docker network ls
docker network inspect <network>
# Test connectivity from a container:
docker exec <container> ping <other-container>
docker exec <container> curl -v http://service:port

Data volumes

docker volume ls
docker volume inspect <volume>
docker run --rm -v <volume>:/data alpine ls -la /data   # inspect volume contents

Troubleshooting

Container exits immediately

docker logs <container>                   # check exit reason
docker inspect <container> --format '{{.State.ExitCode}}'
# Common causes:
#   0  → clean exit (expected?)
#   1  → application error (check logs)
#   137 → SIGKILL (OOM kill)
#   139 → segfault

Disk space issues

docker system df                          # disk overview
du -sh /var/lib/docker/containers/        # container overlay sizes
bash scripts/docker-cleanup.sh --aggressive

Container can't resolve DNS

docker exec <container> cat /etc/resolv.conf
# Fix: add to docker-compose.yml
#   dns:
#     - 8.8.8.8
#     - 1.1.1.1

Permission errors

# Add user to docker group
sudo usermod -aG docker $USER && newgrp docker

Resources

  • scripts/docker-cleanup.sh — Interactive cleanup with dry-run mode
  • scripts/docker-health.sh — Multi-container health overview
  • scripts/docker-log-inspector.py — Regex filtering + severity summary for logs
  • references/compose-patterns.md — Docker Compose patterns and recipes

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Web Scraper

Python web scraping toolkit for data extraction, pagination handling, anti-blocking techniques, Selenium for JavaScript-heavy sites, and structured output (J...

Registry SourceRecently Updated
Coding

China Top Doctor Referral

OceanBus-powered top-tier hospital specialist referral service for high-end medical insurance clients. Use when users need to search and book leading special...

Registry SourceRecently Updated
Coding

GitHub PR Manager

GitHub Pull Request lifecycle management — create, review, merge, changelog generation, CI checks, conflict resolution, and draft management via gh CLI. Use...

Registry SourceRecently Updated
Coding

婴儿智能安全看护技能

Monitors infant behavior via visual AI, automatically identifying high-risk actions like rolling over, mouth/nose obstruction, climbing, or falling from bed,...

Registry SourceRecently Updated