-
Notifications
You must be signed in to change notification settings - Fork 3
Useful docker commands
Filipe Pereira edited this page Oct 12, 2017
·
1 revision
Remove all volumes not explicitly named on docker-compose
docker volume ls | tr -s ' ' | cut -d ' ' -f 2 | grep '.\{64\}' | xargs docker volume rm
Remove all volumes excluding a pattern (Ex. ending in '_data')
docker volume ls | tr -s ' ' | cut -d ' ' -f 2 | grep -v '_data$
Remove all volumes including a pattern (Ex. ending in '_data')
docker volume ls | tr -s ' ' | cut -d ' ' -f 2 | grep '_data$