A function has been added in order to remove all the orphan docker layers

This commit is contained in:
Sameer Rahmani 2018-01-15 17:22:26 +00:00
parent df5c7a0eed
commit 0cc621f3d9
2 changed files with 7 additions and 1 deletions

View File

@ -78,8 +78,9 @@ alias co="chown "
alias d="docker"
alias d-="docker-compose"
alias dall="docker ps -a -q"
alias dstop="docker ps -a -q"
alias drm='d stop `dall`;d rm `dall`'
alias drmi='docker_remove_orphan_layers'
alias a="apt"
alias ai="apt install"
@ -95,3 +96,4 @@ alias l="lein"
alias copy="xclip -sel clip <"
alias x="_ ~/.xinitrc"
alias reload="source ~/.zshrc"

4
lib/docker.zsh Normal file
View File

@ -0,0 +1,4 @@
# Removes all the docker layers which are orphans
docker_remove_orphan_layers() {
docker rmi $(echo -n `d images|grep none`|sed 's/<none> <none>/\n/mg'|cut -d ' ' -f 2)
}