- Listing containers
- Retrieving detailed JSON metadata
- Monitoring live resource usage
- Viewing in-container processes
- Fetching and streaming logs
- Streaming Docker system events
1. List Running Containers
Before diving deeper, get a quick overview of containers on your host:2. Inspect Container Details
To view in-depth information—configuration, network settings, volumes—use:Use
-f json to pipe this output into jq or other JSON parsers for selective querying.3. Monitor Resource Usage
Docker can stream real-time metrics—CPU, memory, network I/O, block I/O—across all running containers:The
stats command runs continuously. Press Ctrl+C to stop the stream.4. List Processes Inside a Container
Identify which processes are consuming resources within a specific container:stress process (host PID 17001) running inside webapp.
5. Fetch and Stream Container Logs
To retrieve application logs:If your logs are large, consider limiting output with options like
--since or --tail to avoid overwhelming your terminal.6. Stream Docker Events
Docker records events for containers, networks, volumes, and more. To see recent events—for example, within the last hour—run:docker system events.
Summary of Inspection Commands
Links and References
- Docker Inspect Documentation
- Docker Stats Documentation
- Docker Logs Documentation
- Docker Events Documentation