清理Docker映像占用的磁盘空间 [英] Cleanup disk space occupied by Docker images

查看:81
本文介绍了清理Docker映像占用的磁盘空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 10上运行docker.

I am running docker on windows 10.

我的机器中存储了几张图像.这些图像的总大小约为10GB.我已经通过" docker rmi -f "命令删除了这些图像.

I had a couple of images stored in my machine. The total size of these images accumulated to around ~10GB. I have deleted these images via 'docker rmi -f' command.

但是这些图像所占用的空间尚未释放.如果我运行"docker images"命令,则删除的图像未在"docker images"命令的输出中列出(但磁盘空间未清理).

But the space occupied by these images has not been released. If I run 'docker images' command, the deleted images are not listed in the output of 'docker images' command(but the disk space is not cleaned up).

如何改善(即减少)码头工人使用的磁盘空间?

How can I improve (ie. reduce) the disk space used by docker?

推荐答案

首先尝试运行:

docker系统修剪

它将删除:

  • 所有停止的容器
  • 至少一个容器未使用的所有卷
  • 至少一个容器未使用的所有网络
  • 所有悬空的图像

如果这还不够,请执行以下操作:

docker系统修剪-a

它将删除:

  • 所有停止的容器
  • 至少一个容器未使用的所有卷
  • 至少一个容器未使用的所有网络
  • 所有没有至少一个与之关联的容器的图像

如果您没有达到预期的效果,请尝试以下操作

docker volume prune

它将删除至少一个容器未使用的所有本地卷.

It will remove all local volumes not used by at least one container.

这篇关于清理Docker映像占用的磁盘空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆