Created
June 12, 2019 20:08
-
-
Save DeepInThought/1f077a8a5c63355c1c1cab0333757a7e to your computer and use it in GitHub Desktop.
Lukes collection of docker 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
#file: ~/.docker/.docker_aliases | |
#? REF: https://dev.to/argherna/bash-functions-and-aliases-for-the-beginning-docker-developer-d4 | |
alias docker-print-aliases='cat ~/.docker/.docker_aliases' | |
alias d-att='docker attach' | |
alias dc-b='docker-compose build' | |
alias dc-logs='docker-compose logs' | |
alias dc-u='docker-compose up' | |
alias d-diff='docker diff' | |
alias d-img='docker images' | |
alias d-ins='docker inspect' | |
alias d-ps='docker ps' | |
alias d-rm='docker rm' | |
alias d-rmi='docker rmi' | |
alias d-rmi-img-all='docker rmi $(docker images -q)' | |
alias d-vol-rm-dangling='docker volume rm $(docker volume ls -q -f dangling=true)' | |
alias d-run='docker run' | |
alias d-start='docker start' | |
alias dl='docker ps -l -q' | |
alias d-l-id='docker ps -l -q' | |
alias d-l-ip=`docker inspect $(dl) 2>&1 | grep -wm1 IPAddress | cut -d '"' -f 4` | |
alias d-l-ip-json='docker inspect $(dl) | jq -r '.[0].NetworkSettings.IPAddress'' | |
alias d-stop='docker stop' | |
alias d-c-kill='docker kill $(docker ps -q)' | |
alias d-c-rm-force='docker rm -f $(docker ps -qa)' | |
alias d-c-rm-old=`$(docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs docker rm 2>/dev/null)` | |
alias d-c-rm-stop='docker rm -v $(docker ps -a -q -f status=exited)' | |
# Credit to <https://stackoverflow.com/a/21928864/37776> | |
alias d-restart-f='docker start $(docker ps -ql) && docker attach $(docker ps -ql)' | |
# Credit to <https://gist.github.com/bastman/5b57ddb3c11942094f8d0a97d461b430#remove-docker-images> | |
alias d-rmi-imgs='docker rmi $(docker images --filter "dangling=true" -q --no-trunc)' | |
### Function Aliases ### | |
alias d-e-b='docker_exec_container_bash' | |
alias dc-e-b='docker_compose_exec_bash' | |
alias d-ben-sec='docker_security_bench_run' | |
### App Aliases ### | |
alias d-apps='alias -p | grep -i "d-a-"' | |
alias d-a-dive='/usr/local/bin/dive' | |
alias d-a-dry='/usr/local/bin/dry' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment