I've the following images:
alex@alexvps:~$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
<none> <none> 70c0e19168cf 5 days ago 1.069 GB
<none> <none> c2ce80b62174 8 days ago 399.2 MB
<none> <none> 60afe4036d97 8 days ago 325.1 MB
and when I try to remove one of them I get:
alex@alexvps:~$ sudo docker rmi 60afe4036d97
Error: Conflict, 60afe4036d97 wasn't deleted
2014/01/28 00:54:00 Error: failed to remove one or more images
How can I remove them? Why is there such conflict?
In order to delete all images, use the given command
In order to delete all containers, use the given command
Warning: This will destroy all your images and containers. It will not be possible to restore them!
This solution is provided by Techoverflow.net.
I found the answer in this command:
I had your problem when I deleted some images that were being used, and I didn't realise (using
docker ps -a
).The most compact version of a command to remove all untagged images is:
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:
If you cannnot find container by docker ps, you can use this to list all already exited containers and remove them.
Note: Be careful of deleting all exited containers at once in case you use
Volume-Only
containers. These stay inExit
state, but contains useful data.