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
Table of Contents
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
Hello! I am Narayanaswamy founder and admin of narayanatutorial.com. I have been working in the IT industry for more than 12 years. NarayanaTutorial is my web technologies blog. My specialties are Java / J2EE, Spring, Hibernate, Struts, Webservices, PHP, Oracle, MySQL, SQLServer, Web Hosting, Website Development, and IAM(ForgeRock) Specialist
I am a self-learner and passionate about training and writing. I am always trying my best to share my knowledge through my blog.