Merge pull request #909 from dsem/add-docker-cleanup

Add plugin and alias for cleaning docker assets
This commit is contained in:
Nils Winkler
2017-02-16 09:55:36 +01:00
committed by GitHub
2 changed files with 8 additions and 0 deletions

View File

@@ -13,6 +13,13 @@ function docker-remove-most-recent-image() {
docker images -q | head -1 | 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'