How to Remove Orphaned Volumes in Docker
When using Docker sometimes it's necessary to do some cleanup in order to free up space. I ran into an issue recently where I could not start my database container. The error message was:
db_1 | creating subdirectories ... initdb: could not create directory "/var/lib/postgresql/data/global": No space left on device
One simple way to free up space is to delete dangling or orphaned volumes. A dangling volume is a volume that is not referenced by any container.