Server started on port 3000
GET /api/health 200 2ms
POST /api/users 201 45ms
Note Combine --tail to avoid the initial flood and --since to only see recent entries. Pressing Ctrl+C stops following but does not affect the container.
Note Alpine-based images have sh but not bash. If the container has no shell at all (distroless or scratch), you can use docker debug (Docker Desktop) or copy a static busybox binary in via docker cp.
Note Returns comprehensive JSON with networking, mounts, environment, state, and configuration. The --format flag with Go templates extracts exactly what you need without piping through jq.
Note Shows the process tree from the host's perspective. Useful for confirming which processes are actually running and spotting zombie or unexpected processes.
container processestopps in containerrunning processes
Note Streams lifecycle events (create, start, die, destroy, OOM) in real time. Filter by container, image, or event type. Exit code 137 means OOM killed (128 + signal 9).
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 15 5 4.2GB 2.8GB (66%)
Containers 8 3 125MB 95MB (76%)
Volumes 6 3 1.1GB 400MB (36%)
Build Cache - - 850MB 850MB
Note Quick overview of what is consuming disk. Add -v for a per-item breakdown. The RECLAIMABLE column shows how much you can free with prune commands.
disk usagedocker spacewhat is using diskstorage breakdownreclaim space
System-Wide Cleanup
syntax
docker system prune [options]
example
docker system prune
docker system prune -a --volumes
output
Total reclaimed space: 5.7GB
Note Without flags: removes stopped containers, unused networks, dangling images, and build cache. With -a: also removes all unused images (not just dangling). With --volumes: also removes unused volumes. This is the nuclear option — it can delete data you care about.
system pruneclean everythingfree spacedocker cleanupreclaim disk
Note Works on both running and stopped containers. Useful for extracting crash logs or injecting a config file for debugging. Changes via cp do not persist across container recreation — use volumes for anything permanent.
copy filesdocker cpextract fileinject fileget logs from container
See Filesystem Changes
syntax
docker diff <container>
example
docker diff web-api
output
C /app
A /app/logs/error.log
A /tmp/cache-abc123
D /app/config.bak
Note Shows which files were Added (A), Changed (C), or Deleted (D) compared to the image. Handy for understanding what the running process has modified on disk.