Inspect a Docker Environment
Use this skill to get a reliable, read-only picture of what Docker is running on a machine before doing anything else.
Workflow
1. Daemon health
docker info # engine info; confirms daemon is reachable
docker version # client + server versions
docker system df # disk usage: images, containers, volumes, cache
If docker info fails, stop — the daemon is not reachable and nothing below
will work.
2. Inventory
docker ps -a # every container (running + stopped)
docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'
docker images # local images
docker network ls
docker volume ls
docker compose ls -a # compose projects (uses compose plugin)
3. Focus on what matters
For the user's question, drill into the relevant objects:
- Containers:
docker inspect <name>for mounts, ports, env, restart policy. - Images:
docker image inspect <image>for layers/size, ordocker historyfor build steps. - Networks:
docker network inspect <net>for members and subnet. - Volumes:
docker volume inspect <vol>for mountpoint and driver.
4. Report
Give a compact inventory: N running/stopped containers, notable images and their
sizes, networks with their members, volumes, and any red flags (unused images,
stale volumes, containers with no restart policy, latest tags). Prioritize
facts that are relevant to the user's task.
Guardrails
- Entirely read-only. Never
docker rm,docker rmi,docker volume prune, ordocker system pruneunless the user explicitly requests cleanup. - On large environments, prefer
--formatprojections anddocker system dfover dumping every container's full inspect.