docker rmi cannot remove images, with: no such id

2019-03-08 04:45发布

I have a lot of images. When I try to remove them with docker rmi

$ sudo docker rmi acd33a9490dc
Error response from daemon: No such id: 75ce1f6710bab109a7d7cbee056fa8a0c7fa913e81c88e2a55121149dda80ee9
2014/07/14 10:13:24 Error: failed to remove one or more images

That 75ce1... hash is the same no matter which docker image I try to remove.

At present, the below gives the current docker version; however some of these images have been around since an earlier version (0.6 or so)

$ sudo docker version
Client version: 1.0.1
Client API version: 1.12
Go version (client): go1.2.1
Git commit (client): 990021a
Server version: 1.0.1
Server API version: 1.12
Go version (server): go1.2.1
Git commit (server): 990021a

标签: docker
9条回答
成全新的幸福
2楼-- · 2019-03-08 05:42

this will remove all your container and then you can remove the images

sudo docker ps -a | awk '{print $1}' | grep -v CONTAINER | xargs sudo docker rm {}\;

查看更多
ゆ 、 Hurt°
3楼-- · 2019-03-08 05:44

Running this cleanup script I made somehow magically solves this for me:

# remove orphan containers
docker ps -a | grep -v ":" | awk '{print $1}' | xargs docker rm -f

# remove orphan images
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi -f
查看更多
Lonely孤独者°
4楼-- · 2019-03-08 05:45

You may also face this issue if you do not remove exited containers. You need to remove the exited container by doing this,

sudo docker ps -a | grep Exit | awk '{print $1}' | sudo xargs docker rm 

Then remove your image using

sudo docker rmi <imageID>
查看更多
登录 后发表回答