马达加斯加
Docker采取了一种保守的方法来清理未使用的对象(通常称为“垃圾收集”),例如图像,容器,卷和网络:除非您明确要求Docker这样做,否则通常不会删除这些对象。这可能会导致Docker使用额外的磁盘空间。对于每种类型的对象,Docker提供一个prune命令。此外,您可以docker system prune用来一次清除多种类型的对象。
清理网络
Docker网络不会占用太多磁盘空间,但它们确实会创建iptables 规则,桥接网络设备和路由表条目。要清理这些东西,您可以docker network prune用来清理任何容器都没有使用的网络。
$ docker network prune
WARNING! This will remove all networks not used by at least one container.
Are you sure you want to continue? [y/N] y
默认情况下,系统会提示您继续。要绕过提示,请使用-f或 --force标志。
默认情况下,将删除所有未使用的网络。您可以使用该--filter标志限制范围。例如,以下命令仅删除24小时之前的网络:
$ docker network prune --filter "until=24h"
全部清理
该docker system prune命令是修剪图像,容器和网络的快捷方式。默认情况下,不修剪卷,并且必须指定--volumes用于docker system prune修剪卷的 标志。
$ docker system prune
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all build cache
Are you sure you want to continue? [y/N] y
要同时修剪卷,请添加--volumes标志:
$ docker system prune --volumes
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all volumes not used by at least one container
- all dangling images
- all build cache
Are you sure you want to continue? [y/N] y
默认情况下,系统会提示您继续。要绕过提示,请使用-f或 --force标志。
- ·标签: 龙湖集团 冠寓 天街 佑佑宝贝
- ·标签: 兰亭集势 LITB 财报 跨境电商
- ·豆包大模型1.6-vision正式发布,对比上一代综合成本降低约50%
- ·谷歌 Gemini Live AI 助手全新功能上线,实时互动更智能
- ·阿里云2024财年Q1 经调整EBITA利润3.87亿元
- ·中华人民共和国宗教
- ·云计算开发:Python内置函数-float() 函数详解
- ·标签: 宝马 齐普策 NeueKlasse 汽车关税
- ·慌不慌?机器人开始有了一丝同理心,能预测机器人伙伴的下一动作!
- ·生物医学工程
- ·标签: 广汽集团 广汽传祺 广汽埃安 广汽昊铂
- ·2030年國際足協世界盃
- ·云计算开发:Python3三角函数acos()方法详解
- ·通义千问开源Qwen2.5大模型,性能超越Llama
- ·Kubernetes如何成为容器优秀实践
- ·即梦图片4.0重磅发布:文生图、图像编辑、组图生成一站式搞定
