Created
March 19, 2023 17:43
-
-
Save Sanix-Darker/e94058aede7f114fe94dca8cbba5bc2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clean_volumes(){ | |
# List all volumes from docker volume | |
# then remove the first line | |
# sed to delete "local " from the /tmp/volumes | |
# and then apply the docker volume rm on each lines from that file | |
docker volume ls > /tmp/volumes && \ | |
tail -n +2 /tmp/volumes && \ | |
sed -i 's/local //g' /tmp/volumes && \ | |
while read in; do docker volume rm "$in"; sleep 1; done < /tmp/volumes | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment