Last active
August 29, 2015 14:04
-
-
Save diginc/a97090e2c0443b1d689e to your computer and use it in GitHub Desktop.
docker bash aliases
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
alias sdo='sudo docker' | |
function dockinfo { | |
if [ -z "$1" ] ; then | |
echo "dockinfo usage: dockinfo <container> [inspect format string]" | |
echo -e """ Example inspection elements:\n "Args"\n "Config"\n "Created"\n "Driver"\n "ExecDriver"\n "HostConfig"\n "HostnamePath"\n "HostsPath"\n "Id"\n "Image"\n "MountLabel"\n "Name"\n "NetworkSettings"\n "Path"\n "ProcessLabel"\n "ResolvConfPath"\n "State"\n "Volumes"\n "VolumesRW"\n""" | |
# Generated list with: sudo docker inspect test_jenkins | grep -Po '^ {4}"\w+"' | |
kill -INT $$ | |
else | |
CONTAINER="$1" | |
fi; | |
if [ -z "$2" ] ; then | |
INSPECT='.'; | |
else | |
INSPECT="$2"; | |
fi; | |
sudo docker inspect -f "{{ json $INSPECT }}" $CONTAINER | python -mjson.tool | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment