# conflict: unable to remove repository reference (must force) - container is using its referenced image

**Code:** `conflict: unable to remove repository reference` · **Category:** Docker · **Seen on:** Docker

You tried to delete an image that a container — even a stopped one — still uses.

## 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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/docker/image-is-being-used-by-stopped-container)
