Created
January 15, 2015 19:12
-
-
Save rpherrera/f326f376411d9ca9788c to your computer and use it in GitHub Desktop.
docker dockviz view containers images gnome
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 | |
# Install dockviz: | |
# https://github.com/justone/dockviz | |
# You can import it from .bashrc with the following commands (assuming you saved this script in '~/bin': | |
# echo ". ~/bin/dockviz-containers-images.sh" >>~/.bashrc | |
# source ~/.bashrc | |
function dockviz_containers() { | |
timestamp=`date +%s` | |
mkdir -p ~/tmp | |
echo -e "GET /containers/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | tail -n +5 | dockviz containers --dot | dot -Tpng -o ~/tmp/containers-${timestamp}.png && gnome-open ~/tmp/containers-${timestamp}.png | |
} | |
function dockviz_images() { | |
timestamp=`date +%s` | |
mkdir -p ~/tmp | |
echo -e "GET /images/json?all=1 HTTP/1.0\r\n" | nc -U /var/run/docker.sock | tail -n +5 | dockviz images --dot | dot -Tpng -o ~/tmp/images-${timestamp}.png && gnome-open ~/tmp/images-${timestamp}.png | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment