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)

相关推荐
辉的技术笔记3 小时前
Dify 自部署为什么跑不动?6 层瓶颈诊断法教你定位
docker
程序员老赵1 天前
Docker 部署 Redmine:老牌开源项目管理部署实测记录
docker·开源·团队管理
程序员老赵1 天前
服务器文件不想 SFTP 上传?Docker 跑个 File Browser,浏览器就能管理
服务器·docker·开源
lichenyang4533 天前
Docker 学习笔记(五):Docker Compose,用一个 YAML 启动前端、后端和 MongoDB
docker
lichenyang4533 天前
Docker 学习笔记(四):Dockerfile,把项目打成自己的镜像
docker·容器
lichenyang4533 天前
Docker 学习笔记(三):Docker 网络、bridge、子网和容器互通
docker·容器
lichenyang4533 天前
Docker 学习笔记(二):docker run 的参数到底在控制什么?
docker·容器
Patrick_Wilson8 天前
从「改个端口」到 502:Next.js on k8s 的容器端口、Service 映射与 env 覆盖
docker·kubernetes·next.js
Suroy8 天前
DockerView-Go:用 Go 写一个终端 Docker 监控工具,顺便做了个 Web 仪表盘
docker
云恒要逆袭8 天前
运行你的第一个Docker容器
后端·docker·容器