DEV Community

chanduthedev
chanduthedev

Posted on

2

Error when trying to delete docker image

When I try to remove docker image using docker rmi image-id, many times I got below error.
Error response from daemon: conflict: unable to delete e3c37a7601a1 (must be forced) - image is referenced in multiple repositories

Which means image was used by some other process.
But When I use docker ps to get docker process, got empty container list.

Follow below three steps to delete docker image if you get this error.

Step1. Use below command to show all container list.

docker ps -a

Step2. User below command to remove container

docker rm container-id

Step3. Use below command to remove docker image.
docker rmi image-id

Another way to delete docker unused containers.

This will delete all unused containers, networks, images (both dangling and unreferenced).

docker system prune

Be cautious while using this command as it will delete all containers.

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay