Search code examples
macosdockerdocker-volume

Is there a way to determine the size of a docker volume on my macOS machine?


I'm aware of docker volume ls and docker inspect -s, but the former doesn't show size info and the latter, even though it has a --size option, ignores it for volumes.

Is there something I'm missing?


Solution

  • This:

    docker volume inspect --format '{{ .Mountpoint }}' volumeNameHere
    

    will return the mount point of the volume on your host. So, to get the size, it's just a matter of doing:

    du -sh $(docker volume inspect --format '{{ .Mountpoint }}' volumeNameHere)