runtime: docker engine · compose v2

Docker & Compose Operations

Container inspection, log tailing, Compose v2 deployments, safe disk pruning, network debugging, and image portability.

Container Status & Inspection

Clean ps formatting, live resource stats, and quick IP extraction.

containers debug
Compact container table with status and ports
docker ps -a --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
One-shot CPU, RAM, and I/O snapshot
docker stats --no-stream
Get container IPs across attached networks
docker inspect -f '{{range $k,$v := .NetworkSettings.Networks}}{{$k}}: {{$v.IPAddress}} {{end}}' <container>

Logs & Interactive Shell

Follow recent timestamped logs and enter running containers.

logs exec
Tail last 100 log lines with timestamps
docker logs -f --tail 100 -t <container>
Open shell inside container (sh fallback)
docker exec -it <container> sh
Check running processes & exit code
docker top <container> && docker inspect -f 'Exit: {{.State.ExitCode}} OOM: {{.State.OOMKilled}}' <container>

Docker Compose v2 Workflow

Pull, rebuild, recreate orphans cleanly, and stream service logs.

compose lifecycle
Pull, rebuild, and start detached stack
docker compose pull && docker compose up -d --build --remove-orphans
Check stack services and follow logs
docker compose ps && docker compose logs -f --tail 60
Recreate a single service without touching dependencies
docker compose up -d --no-deps --force-recreate <service>

Disk Usage & Safe Pruning

Inspect space consumed by images, build cache, and stale containers.

cleanup disk
Breakdown of Docker disk usage
docker system df -v
Prune unused images older than 7 days
docker image prune -af --filter "until=168h"
Clear BuildKit cache and stopped containers
docker container prune -f && docker builder prune -f

Networks & Volumes

Inspect bridge subnets, attached endpoints, and volume contents.

networks volumes
List networks and inspect subnet/containers
docker network ls && docker network inspect <network>
List volumes and inspect mountpoint
docker volume ls && docker volume inspect <volume>
Browse a named volume via ephemeral Alpine container
docker run --rm -v <volume>:/data:ro alpine ls -lah /data

Ephemeral Debug Sidecars

Attach network tools directly into a target container namespace.

debug networks
Share target container network stack with netshoot
docker run --rm -it --network container:<target> nicolaka/netshoot
Inspect filesystem changes inside container
docker diff <container>
Stream recent Docker daemon events
docker events --since 30m

Image Export, Save & Load

Transfer images offline between air-gapped or European nodes.

images backup
List local images with immutable digests
docker image ls --digests
Save compressed image archive
docker save <image:tag> | gzip > image.tar.gz
Load image archive on destination host
docker load < image.tar.gz

Daemon Health & Log Drivers

Verify storage driver, cgroup v2, and container log file size.

daemon logs
Check storage, logging, and cgroup drivers
docker info --format 'Storage: {{.Driver}} | Log: {{.LoggingDriver}} | Cgroup: {{.CgroupDriver}} (v{{.CgroupVersion}})'
Find largest container json-file logs on host
du -sh /var/lib/docker/containers/*/*-json.log 2>/dev/null | sort -hr | head -n 10
Check docker & containerd service journal
journalctl -u docker -u containerd --since "1 hour ago" --no-pager

No matching command groups found on this page.