I have a large Docker volume (300GB) that I want to get rid of. The problem is I can’t figure out what’s using it.
I’ve already run:
docker volume prune
docker system prune -a --volumes
and the volume is still there, which indicates something is using it.
Running docker ps -a --filter volume=VOLUME_NAME
returns zero results.
How can I figure out what this volume is being used for?
2
Answers
First of all, Checking docker Container Id
and There will be JSON output, look at "Mounts" section to see if the volume you’re trying to delete is mounted inside that container.
That statement was true until very recently indeed, but, has, now, changed.
As of Docker 23.0.0, the
docker volume prune
command consider all named volumes should be kept, regardless of their usage.Here is the issue on their GitHub tracker discussing that matter: https://github.com/docker/cli/issues/4028
If this is your case, you can run either
or, since 23.0.5
Sources: