conflict: unable to remove repository reference (must force) - container is using its referenced image
You tried to delete an image that a container — even a stopped one — still uses.
Seen on:
Docker
Meaning
Stopped containers keep a reference to their image. Remove the containers first (or use docker image prune / docker system prune), or force-remove the image tag.
Common causes
- Stopped containers created from the image still exist
- Compose project containers not removed (docker compose down not run)
⚡ Quick fix
- Remove the container(s): docker rm <id>
- Clean up: docker container prune then docker image prune
- Force only if you know the container is disposable: docker rmi -f
Detailed fix by platform
Docker
- bash
docker ps -a --filter ancestor=myimage:1.0 docker rm $(docker ps -aq --filter ancestor=myimage:1.0) docker rmi myimage:1.0
How to diagnose
- Users — docker ps -a --filter ancestor=image
- Compose — docker compose ls
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Docker
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026