Mercurial > hg > zsh-env
changeset 141:fe986adeadeb
add more helper functions
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 05 Jul 2018 04:58:14 +0200 |
parents | abc3d303adde |
children | 279d1363e918 |
files | zshrc-docker |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/zshrc-docker Wed Jul 04 17:04:39 2018 +0200 +++ b/zshrc-docker Thu Jul 05 04:58:14 2018 +0200 @@ -10,3 +10,11 @@ alias dpa="docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}'" dex() { docker exec -it $1 /bin/sh } + +docker_remove_obsolete_images() { + docker rmi $(docker images --format 'table {{.Repository}} {{.ID}}' | grep -e '^<none>' | awk '{ print $2 }') +} + +docker_remove_exited_containers() { + docker rm $(docker ps -a | grep "Exited" | awk '{print $(NF)}') +}