gpt4 book ai didi

docker - 清理 Docker/var/lib/docker/devicemapper

转载 作者:行者123 更新时间:2023-12-02 02:48:49 27 4
gpt4 key购买 nike

您好,有人知道如何清理 docker devicemapper 文件吗?

我已经清理了所有图像/容器,但设备映射器文件仍然异常大:

 docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
gitlab/gitlab-ce latest 735fdb05ad5d 27 hours ago 1.225 GB
<none> <none> 06fefa4a9183 6 weeks ago 1.077 GB
rancher/agent-instance v0.6.0 134980b9bbfb 6 months ago 635.6 MB
<none> <none> 06d5beefe33e 6 months ago 635.6 MB
<none> <none> e172255e7648 6 months ago 495.6 MB
<none> <none> c20ca66652e8 6 months ago 495.6 MB
<none> <none> e736ae48fd3a 6 months ago 483.8 MB
<none> <none> 8239904dd749 6 months ago 472.1 MB
<none> <none> b780de634713 6 months ago 472.1 MB
<none> <none> eda17c9d109e 6 months ago 472.1 MB
<none> <none> 2ec6b457b5d8 6 months ago 300.6 MB
<none> <none> a15c0b4b75b1 6 months ago 300.6 MB
<none> <none> b6501c507a32 6 months ago 300.1 MB
rancher/agent v0.8.2 4de7ef5d11e3 8 months ago 365 MB
<none> <none> a0ff15f1f8ad 8 months ago 365 MB
<none> <none> 4bb3b77da9b1 8 months ago 365 MB
<none> <none> 8410b01d3f42 8 months ago 365 MB
<none> <none> 4068f49bc382 9 months ago 365 MB
<none> <none> 2a6ec0cadaec 9 months ago 365 MB
<none> <none> 8ca7bc756812 9 months ago 342.4 MB
<none> <none> b6cc9819d3f4 9 months ago 321.4 MB
<none> <none> d760275f41ff 9 months ago 306 MB
<none> <none> 1c524e41e113 9 months ago 305.5 MB
<none> <none> 4bec63e16966 9 months ago 260.8 MB
<none> <none> 574422a69939 9 months ago 256.7 MB
<none> <none> d5ddd9bb3635 9 months ago 247.2 MB
<none> <none> 44ae5d2a191e 9 months ago 188.3 MB
<none> <none> 62df8e845c12 9 months ago 188.3 MB
<none> <none> b6a4b778253d 9 months ago 188.3 MB
<none> <none> 7d8a588d75a5 9 months ago 188.1 MB
<none> <none> 3f55b715e2c4 2 years ago 299.7 MB
<none> <none> 1bc5ec756ec9 2 years ago 192.6 MB
<none> <none> 3463aff75755 2 years ago 192.7 MB
<none> <none> 1013ce565837 2 years ago 192.6 MB
<none> <none> 5806993e4389 2 years ago 192.6 MB
<none> <none> bd64f000e711 2 years ago 192.6 MB
<none> <none> e73baccf8d9e 2 years ago 192.6 MB
<none> <none> 6b7491a446ad 2 years ago 192.6 MB
<none> <none> c2910096a074 2 years ago 192.5 MB
<none> <none> cf2172af6603 2 years ago 192.5 MB

图像总计约为 15GB,而 devicemapper 文件为 30GB!

只有一个容器在运行,最大容量为 1GB。

有没有办法将其减小到适当的大小而无需删除 docker 并从 stratch 重新安装?类似于偶尔执行一次的垃圾收集工具?

最佳答案

使用以下命令:

docker rm -v $(docker ps -a -q -f status=exited)

关于docker - 清理 Docker/var/lib/docker/devicemapper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37407826/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com