Unable to delete image

Stopped all containers.
docker container ls -a returns nothing

docker images -a returns a list of images

docker rmi 472b6fcfe871 returns:
Error response from daemon: conflict: unable to delete 472b6fcfe871 (cannot be forced) - image is being used by running container 008b2b2bbf35

What am I doing wrong?

Best regards,
mjda

It’s possible the error message is providing some usable guidance, i.e.

image is being used by running container 008b2b2bbf35

You mention listing images, but it would be useful to see which containers are running on your system. Try this command

docker ps

I suspect you’ll see a running container with the id 008b2b2bbf35. If you do, you can stop the container by using a command similar to this

docker container stop <some_container_id>

OR

docker container kill <some_container_id>

Hi,
docker ps or even docker ps -a return(ed) nothing (I did a “Reset to factory defaults” to begin with a clean installation).

Anyways, thank you for your time.
Best regards,
Z.

Stop all processes from running containers with

docker stop $(docker ps -a -q)

Remove stopped containers.

docker rm $(docker ps -a -q)

Remove images

docker rmi $(docker images -q)

1 Like