Skip to content

Instantly share code, notes, and snippets.

@aduermael
Last active November 18, 2016 19:02
Show Gist options
  • Save aduermael/b9eb63e9f6e590c45652a4a0982de735 to your computer and use it in GitHub Desktop.
Save aduermael/b9eb63e9f6e590c45652a4a0982de735 to your computer and use it in GitHub Desktop.
.bash_profile for docker commands
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