conflict: unable to remove repository reference 🐳 Docker

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

  1. Remove the container(s): docker rm <id>
  2. Clean up: docker container prune then docker image prune
  3. Force only if you know the container is disposable: docker rmi -f

Detailed fix by platform

Docker

  1. 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

  1. Users — docker ps -a --filter ancestor=image
  2. 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:

🧠 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.