如何清理Docker占用的磁盘空间? (2)

还,当我清理了镜像、容器以及数据卷之后,发现磁盘空间并没有减少。根据Docker disk usage提到过的建议,我重启了 Docker,发现磁盘使用率从 83%降到了 19%。根据高手,这应该是与内核 3.13 相关的 BUG,导致 Docker 无法清理一些无用目录:

it's quite likely that for some reason when those container shutdown, docker couldn't remove the directory because the shm device was busy. This tends to happen often on 3.13 kernel. You may want to update it to the 4.4 version supported on trusty 14.04.5 LTS.

The reason it disappeared after a restart, is that daemon probably tried and succeeded to clean up left over data from stopped containers.

我查看了一下内核版本,发现真的是 3.13:

uname -r 3.13.0-86-generic

如果你的内核版本也是 3.13,而且清理磁盘没能成功,不妨重启一下 Docker。当然,这个晚上操作比较靠谱。

参考

谁用光了磁盘?Docker System 命令详解

INTRODUCING DOCKER 1.13

Docker 文档:docker system

Docker disk usage

关于Fundebug

Fundebug专注于JavaScript、微信小程序、微信小游戏、支付宝小程序、React Native、Node.js和Java线上应用实时BUG监控。 自从2016年双十一正式上线,Fundebug累计处理了10亿+错误事件,付费客户有Google、360、金山软件、百姓网等众多品牌企业。欢迎大家免费试用!

如何清理Docker占用的磁盘空间?

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpgwzw.html