Created
January 10, 2022 14:49
-
-
Save keiranmraine/dfad125ee62044284f38c1e11f1a2e0d to your computer and use it in GitHub Desktop.
Script to output docker stats suitable for file while job is running
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ue | |
CONTAINER_ID=$1 | |
# include the header first time | |
docker stats --no-stream $CONTAINER_ID | |
while true; do | |
sleep 10 | |
# will stop automatically once container is dead | |
docker stats --no-stream $CONTAINER_ID | grep -v '^CONTAINER' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment