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
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
Remove all the containers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
Remove the now dangling images
docker images -q --filter "dangling=true" | sudo xargs docker rmi