Add plugin and alias for cleaning docker assets

This commit is contained in:
Dylan Semler
2017-02-15 07:00:42 -05:00
parent c58088b509
commit 20a49e6393
2 changed files with 8 additions and 0 deletions

View File

@@ -13,6 +13,13 @@ function docker-remove-most-recent-image() {
docker images | head -2 | tail -1 | awk '{print $3}' | xargs docker rmi
}
function docker-remove-stale-assets() {
about 'attempt to remove exited containers and dangling images'
group 'docker'
docker ps --filter status=exited -q | xargs docker rm --volumes
docker images --filter dangling=true -q | xargs docker rmi
}
function docker-enter() {
about 'enter the specified docker container using bash'
group 'docker'