一、磁盘清理
# docker system --help
# docker system df --help
# docker system prune --help
二、删除非Up容器
# docker ps --help
# docker rm --help
# docker ps -a | grep "Exited" | awk '{print $1}' | xargs docker rm
# docker ps -a | grep "Dead" | awk '{print $1}' | xargs docker rm
# docker ps -a | grep "Created" | awk '{print $1}' | xargs docker rm
# docker ps -a | grep -E "Exited|Dead|Created" | awk '{print $1}' | xargs docker rm
三、参考
docker system
https://docs.docker.com/engine/reference/commandline/system
如何清理Docker占用的磁盘空间?
http://dockone.io/article/3056
docker空间管理之清理磁盘占用
https://www.cnblogs.com/cuishuai/p/9629576.html
网友评论