Berat Nakip

Docker Remove Unnamed Volumes

August 02, 2020

It’s a basic script to remove unnamed volumes.

docker volume ls --format "{{.Name}}" | while read -r line; do [ "64" == "${#line}" ]&& docker volume rm "$line"; done

This code removes volumes which name has 64 chars. Make sure that you have not any volume name has 64 chars length


Personal blog about my works, thoughts and the technologies I am interested in. Written by Berat Nakip who lives and works in Istanbul. Follow on Twitter