Last active
November 18, 2016 19:02
-
-
Save aduermael/b9eb63e9f6e590c45652a4a0982de735 to your computer and use it in GitHub Desktop.
.bash_profile for docker commands
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
docker() { | |
local realDocker=$(which docker) | |
# shorter `docker ps` | |
if [[ "$1" == "ps" ]] && [[ $* != *-q* ]] | |
then | |
if [[ $* == *-s* ]] | |
then | |
$realDocker $@ --format "table {{.Image}}\t{{.Ports}}\t{{.Status}}\t{{.Names}}\t{{.Size}}" | |
else | |
$realDocker $@ --format "table {{.Image}}\t{{.Ports}}\t{{.Status}}\t{{.Names}}" | |
fi | |
else | |
$realDocker $@ | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment