alias dbl='docker build' alias dcin='docker container inspect' alias dcls='docker container ls' alias dclsa='docker container ls -a' alias dib='docker image build' alias dii='docker image inspect' alias dils='docker image ls' alias dipu='docker image push' alias dirm='docker image rm' alias dit='docker image tag' alias dkil='docker kill' alias dlo='docker container logs' alias dlof='docker container logs --follow' alias dnc='docker network create' alias dncn='docker network connect' alias dndcn='docker network disconnect' alias dni='docker network inspect' alias dnls='docker network ls' alias dnrm='docker network rm' alias dpo='docker container port' alias dpu='docker pull' alias dpsh='docker push' alias dr='docker container run' alias drit='docker container run -it' alias dritbash='docker run -it --entrypoint /bin/bash' alias dritp='docker container run -it -v $PWD:/pwd -w /pwd' alias dritprm='docker container run --rm -it -v $PWD:/pwd -w /pwd' alias dritsh='docker run -it --entrypoint /bin/sh' alias dritshp='docker run -it --entrypoint /bin/sh -v $PWD:/pwd -w /pwd' alias dritrm='docker container run --rm -it' alias drm='docker container rm' alias 'drm!'='docker container rm -f' alias 'drma!'='docker container ls -a -q | xargs docker container rm -f' alias drp='docker container run -v $PWD:/pwd -w /pwd' alias dst='docker container start' alias drs='docker container restart' alias dsta='docker stop $(docker ps -q)' alias dstat='docker container stats' alias dstp='docker container stop' alias dtop='docker top' alias dvi='docker volume inspect' alias dvls='docker volume ls' alias dcprune='docker container prune' alias diprune='docker image prune' alias dvrm='docker volume rm' alias dvprune='docker volume prune' alias dxc='docker container exec' alias dxcit='docker container exec -it' dxcsh() { docker exec -it "$@" /bin/sh } dxcbash() { docker exec -it "$@" /bin/bash } if (( ! $+commands[docker] )); then return fi # Standarized $0 handling # https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" 0="${${(M)0:#/*}:-$PWD/$0}" # If the completion file doesn't exist yet, we need to autoload it and # bind it to `docker`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_docker" ]]; then typeset -g -A _comps autoload -Uz _docker _comps[docker]=_docker fi { # `docker completion` is only available from 23.0.0 on # docker version returns `Docker version 24.0.2, build cb74dfcd85` # with `s:,:` remove the comma after the version, and select third word of it if zstyle -t ':omz:plugins:docker' legacy-completion || \ ! is-at-least 23.0.0 ${${(s:,:z)"$(command docker --version)"}[3]}; then command cp "${0:h}/completions/_docker" "$ZSH_CACHE_DIR/completions/_docker" else command docker completion zsh >| "$ZSH_CACHE_DIR/completions/_docker" fi } &|