Last active
January 31, 2019 09:03
-
-
Save JuryA/9cdc4ff0832a34429af75f24a9278dd1 to your computer and use it in GitHub Desktop.
Linux Shell script - Docker state DUMP
This file contains hidden or 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 | |
################################## | |
# Docker Machines # | |
################################## | |
if [ "$debugging" -gt "0" ] && [ -n $(which docker 2>/dev/null)]; then | |
echo "Docker Info" | |
fi | |
PREVIFS=$IFS | |
IFS="$NEWLINEIFS"; | |
for line in $(docker ps -a --format "{{.ID}}\t{{.Names}}\t{{.Status}}" 2>/dev/null); do | |
vm_ident=$(echo "$line" | awk '{print $1}') | |
name=$(echo "$line" | awk '{print $2}') | |
status=$(echo "$line" | awk '{print $3}') | |
# uuid="" | |
echo -n "$vm_ident:$name:$status" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment