不能删除docker图像,从守护进程的错误响应 [英] cannot remove docker image, error response from daemon

查看:810
本文介绍了不能删除docker图像,从守护进程的错误响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对ubuntu来说很新,所以我可能会有一些简单的事情。我试图用

I'm pretty new to ubuntu so there is probably something simple I am missing. I am trying to remove my docker images with

sudo docker rmi <IMAGE ID>

我收到错误

Error response from daemon: No such Id: 265fdadf...

如果我尝试

sudo docker ps -a | grep <Image ID>

它不返回任何结果。

我不知道这个错误响应是什么意思,为什么我不能删除图像。 Id 265与我的码头图像的实际IMAGE ID不同。

I'm not sure what this error response means and why I cannot delete the image. The Id 265 is different than the actual IMAGE ID of my docker image.

推荐答案

问题(至少对我来说)是在Docker中,退出的容器保留对图像的引用,从而无法删除这些图像。这就是为什么 docker ps -a 是不够的。

The issue (at least for me) was that in Docker the containers that are exited keep the reference to images, so that those images can't be deleted. That's why docker ps -a is not enough.

所以要删除所有的图片使用这两个步骤:

So for deleting all the images use these two steps:

sudo docker ps -a -q --filter "status=exited" | xargs sudo docker rm
sudo docker rmi `sudo docker images -q --filter "dangling=true"`

这篇关于不能删除docker图像,从守护进程的错误响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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