Complete the command to list all running Docker containers.
docker [1]The docker ps command lists all running containers.
Complete the command to show real-time stats of all running containers.
docker [1]The docker stats command shows live metrics like CPU and memory usage for running containers.
Fix the error in the command to get stats for a specific container named 'webapp'.
docker stats [1]To get stats for a specific container, just provide its name or ID after docker stats.
Fill both blanks to create a command that outputs container stats in JSON format and limits output to 5 updates.
docker stats --format '[1]' --no-stream --[2] 5
The --format option customizes output, and --no-stream shows a single snapshot instead of continuous updates.
Fill all three blanks to create a command that filters stats for containers with names starting with 'db' and outputs only CPU percentage.
docker stats --format '{{{{.Name}}}}: {{{{.[1]' --filter name=[2] --no-stream | grep '^[3]'
The --filter name=db limits containers to those starting with 'db'. The format outputs CPU percentage. The grep filters lines starting with 'db'.