Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
Based on this gist.
TODO
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
TODO
$ docker network ls
$ docker network ls | grep "bridge"
$ docker network rm $(docker network ls | grep "bridge" | awk '/ / { print $1 }')
// see: http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images
> docker images
> docker images --filter "dangling=true" -q --no-trunc | ForEach-Object -process {docker rmi $_}
> docker images | % { $_ -replace " +", "," } | convertfrom-csv | Where-Object { ($_.Repository -match "none") -or ($_.Tag -match "none") }
> docker images | % { $_ -replace " +", "," } | convertfrom-csv | Where-Object { ($_.Repository -match "none") -or ($_.Tag -match "none") } | % { docker rmi $_.IMAGE }
// see: http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images
> docker ps
> docker ps -a
> docker ps -qa --no-trunc --filter "status=exited" | ForEach-Object -Process {docker rm $_}
> docker-machine create --driver hyperv --hyperv-disk-size "40000" default