图灵奖获得者约翰・轩尼诗:数据和机器学习让世界变得更美好

晨间快报 2026-07-01 012

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标志。

本文地址:http://cwpc.capital-car-hire.com/news/8ca1893731.html
版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。

全站热门

苹果推出新图像模型 Manzano 实现理解与生成双重能力

为什么是SASE and 零信任,而不是SASE VS 零信任

美团全新推理大模型 LongCat-Flash-Thinking发布

标签: 理想汽车 Nexus 何俊培 人形机器人

IBM收购云解决方案供应商Expertus 扩展混合云数字支付解决方案

标签: 视涯科技 硅基OLED 科创板IPO XR解决方案

标签: 现代汽车 小鹏 Momenta 自动驾驶

阿里巴巴2021财年云计算业务收入601.20亿元 同比增长50%

友情链接