How can I delete Docker's images?

后端 未结 17 1232
执笔经年
执笔经年 2020-11-29 14:27

I\'ve the following images:

alex@alexvps:~$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
&         


        
17条回答
  •  天命终不由人
    2020-11-29 15:03

    Possible reason: The reason can be that this image is currently used by a running container. In such case, you can list running containers, stop the relevant container and then remove the image:

    docker ps
    docker stop 
    docker rm 
    docker rmi 
    

    If you cannnot find container by docker ps, you can use this to list all already exited containers and remove them.

    docker ps -a | grep 60afe4036d97
    docker rm 
    

    Note: Be careful of deleting all exited containers at once in case you use Volume-Only containers. These stay in Exit state, but contains useful data.

提交回复
热议问题