Clearing unused (dangling) docker volumes

Problem

After you start using and building Docker images, there is a case that there is a lot of space used even after deleting images and containers (a few GB maybe).

Solution

To clean out the volumes that are no longer used (ie dangling) use the following:

sudo docker volume ls -qf dangling=true | xargs -r sudo docker volume rm