Last active
December 25, 2021 18:55
-
-
Save genie-oh/d73a224e7cb3cffab2868182eb79ccad to your computer and use it in GitHub Desktop.
my favirote alias for docker (for git bash on windows)
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
# import this file on your ~/.bash_profile or ~/.bash_rc | |
# if [ -f ~/.myalias ]; then | |
# source ~/.myalias | |
# fi | |
# show full command & execute | |
alias al='_(){ CMD=$(alias | grep "alias $1=" | cut -d = -f 2- | sed "s:^.\(.*\).$:\1:"); ARG=$(echo $@ | sed "s/^$1//"); CMD="${CMD}${ARG}"; echo "execute : ${CMD}"; echo " "; bash -c "${CMD}"; };_' | |
# docker | |
alias al-dock='cat ~/.myalias | grep dock | sed "s/=/ \t\= /"' | |
alias dock='docker' | |
alias docki='docker images' | |
alias dockps='docker ps -a' | |
alias dockrrm='docker run --rm' | |
alias dockeit='docker exec -it' | |
alias dockrm='docker rm -f' | |
alias dockrmi='docker rmi -f' | |
alias dockrma='docker rm -f $(docker ps -aq)' | |
alias dockrmia='docker rmi -f $(docker images -aq)' | |
alias dockins='docker inspect' | |
alias dockip='docker inspect --format="{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}"' | |
alias docklogs='dock logs --tail 50 --follow --timestamps' | |
alias dockc='docker-compose' | |
alias dockcb='docker-compose build' | |
alias dockcu='docker-compose up -d' | |
alias dockcd='docker-compose down' | |
alias dockccl='grep container_name docker-compose.yml' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment