docker rmi cannot remove images, with: no such id

前端 未结 9 1356
感情败类
感情败类 2021-01-30 12:52

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: 75ce1f6710b         


        
9条回答
  •  醉酒成梦
    2021-01-30 13:23

    First you need to locate the container holding the image.

    To remove a single container with the image

    docker ps -a
    

    You will get such an output

    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    g7aea2132441        2285ff53ab18        "/bin/bash"         2 days ago                                                  tombrider 
    

    Then remove the container using

    docker rm g7aea2132441
    

    To remove all the containers and images do

    1. Remove all the containers

      docker stop $(docker ps -a -q)
      docker rm $(docker ps -a -q)
      
    2. Remove the now dangling images

      docker images -q --filter "dangling=true" | sudo xargs docker rmi
      

提交回复
热议问题