Docker 深度清除镜像缓存 (overlay2)

Docker 深度清除镜像缓存 (overlay2)

一般情况下,运维清理镜像是通过命令 docker rm i 删除镜像的。但是这条命令不会删除docker build命令产生的缓存文件。

这个时候需要使用 docker system 的系列命令来做相关处理。

shell 复制代码
docker system --help

输出:

复制代码
# 输出
Usage:  docker system COMMAND

Manage Docker

Commands:
  df          Show docker disk usage
  events      Get real time events from the server
  info        Display system-wide information
  prune       Remove unused data

Run 'docker system COMMAND --help' for more information on a command.

查看缓存情况

shell 复制代码
docker system df 

使用命令 prune 将其彻底清理

shell 复制代码
docker system prune -a --force

参数:

-a 删除全部未使用的镜像

-f--force 不经过确认强行删除。

原文链接

Docker 深度清除镜像缓存 (overlay2)

相关推荐
宋均浩5 小时前
# Docker 镜像瘦身实战:从 1.2G 到 80MB 的五个优化步骤
ci/cd·docker
程序员老赵1 天前
10 分钟部署 OpenCode:Docker 一键安装,浏览器打开就能用 AI 写代码(附完整命令与排错)
docker·容器·ai编程
WangMingHua1111 天前
LM Studio Docker 部署——本地大模型一键启动
docker
曲幽2 天前
别再用网页翻译看源码了!你的私人翻译神器LibreTranslate,部署避坑指南来了
python·docker·web·pot·translate·libretranslate·arogstranslate
武子康4 天前
调查研究-183 Apple container:Mac 上用轻量 VM 跑 Linux 容器,Swift 会改写本地容器体验吗?
docker·容器·apple
Alsn867 天前
等待学习-学习目录:Docker 容器安全攻防
学习·安全·docker
ofoxcoding7 天前
在AI API聚合平台配置DeepSeek V3.2提示词缓存实战:快速接入与成本优化指南
人工智能·spring·缓存·ai
程序员老赵7 天前
服务器没有桌面?Docker 跑个 Chrome,浏览器就能远程用
docker·容器·devops
杨浦老苏7 天前
轻量级Docker仪表板Servedash
运维·docker·监控·群晖·仪表板
正经教主7 天前
【docker基础】 第八周:容器监控与应用更新策略
运维·docker·容器