skip to Main Content

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


  1. First of all, Checking docker Container Id

    docker inspect {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.

    Login or Signup to reply.
  2. (…) which indicates something is using it

    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

    docker volume prune --filter all=1
    

    or, since 23.0.5

    docker volume prune --all # or -a
    

    Sources:

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search