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)

相关推荐
九皇叔叔40 分钟前
K8S 资源菜单
docker·容器·kubernetes·k8s
wdfk_prog2 小时前
ROS教程08:从 TransportTCP::connect() 追到 TCPROS Connection Header、序列化与 Socket 数据传输
运维·缓存·docker·容器·ros
zoutao983 小时前
Gitea Actions 自定义 Runner 镜像与自动化部署实战
ci/cd·docker·gitea
小马同学-5 小时前
nerdctl实战:Docker风格的Containerd操作利器
docker·容器·containerd
九皇叔叔5 小时前
Kubernetes 命令式对象配置详解:使用 YAML 管理 Kubernetes 资源
docker·容器·k8s
CVer儿6 小时前
docker内llama.cpp和TRT-LLM win11本机部署qwen3.8
docker
萤火夜6 小时前
Docker(四) Docker介绍
docker·容器
是Dream呀7 小时前
Harness 工程:让 Agent 真正把任务做完
人工智能·分布式·缓存·agent
.冰块.7 小时前
Docker 镜像深度学习:分层 Copy‑on‑Write、Dockerfile 语法、Harbor 私有仓库实操
docker·容器·harbor·镜像·dockerfile·images
szephyr7 小时前
Docker 镜像瘦身实战:从 1.2GB 压到 85MB 的完整过程
docker·容器·部署·多阶段构建·镜像优化