删除volume
// 参考: 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
删除network
$ docker network ls
$ docker network ls | grep "bridge"
$ docker network rm $(docker network ls | grep "bridge" | awk '/ / { print $1 }')
删除Image
// 参考: http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images
$ docker images
$ docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
$ docker images | grep "none"
$ docker rmi $(docker images | grep "none" | awk '/ / { print $3 }')
删除docker container
// 参考: http://stackoverflow.com/questions/32723111/how-to-remove-old-and-unused-docker-images
$ docker ps
$ docker ps -a
$ docker rm $(docker ps -qa --no-trunc --filter "status=exited")
调整Docker虚拟机的磁盘空间
$ docker-machine create --driver virtualbox --virtualbox-disk-size "40000" default