Docker image-is-being-used-by-stopped-container

Sometimes we are unable to delete the docker images and error says that Error response from daemon: conflict: unable to delete 1b79f8f1fcc8 (must be forced) – image is being used by stopped container e688f67acedd

It means that there are stopped containers and causing the lock so first up all delete the stopped containers and then delete the images

Delete stopped container

docker rm <container-id>

Delete Image

docker rmi <image-id>

Stopped Container Ids

docker ps -q -a

Delete All Stopped Container Ids

docker rm $(docker ps -q -a)

And then delete the docker images one by one or all

Delete Image

docker image rm <image_id>

 

Delete All Images

docker image prune -a -all

 

 

 

 

Leave a Reply