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.
unable to remove repository referencecontainer is using its referenced imageimage is being used by stopped container 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
- docker-credential-desktop error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH
- did not complete successfully failed to solve: process "/bin/sh -c ..." did not complete successfully: exit code: 1
- lookup registry-1.docker.io: no such host dial tcp: lookup registry-1.docker.io: no such host / Temporary failure in name resolution during docker build
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 12 Oct 2026