Open athom opened 9 years ago
++ 1 and
cleanup.sh: 3: set: Illegal option -o pipefail
Error HERE allvolumes+="${vid##*/}"
allvolumes+="${bmv}"
im sure the author would accept a PR ;)
finally I solve my problem using such single command line :P
docker ps -a | awk -F" " 'NR>1 {print $1}' | xargs docker rm -v
this command clean up your volumes? without removing the active or used volumes?
sweep all volumes, i am afraid that the active ones are removed too. just my special case
Hi, docker-cleanup-volumes.sh is a bash script, boot2docker does not have bash installed by default so you either have to install bash on it or use the docker image for this script. Also @derek-adair is correct, PR's are welcome :)
boot2docker comes with bash (mingw) but its old...
$ echo $BASH_VERSION
3.1.23(6)-release
not sure if backporting makes sense, but the dockerized version works fine if you ssh into the VM. run Boot2Docker Start an then:
boot2docker ssh
# wait until connection is established...
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes --dry-run
Btw: to paste the docker run ...
line use the mouse/context menu, keyboard shortcuts dont work here.
there is some error when running without --dry-run option:
[vagrant@devenv docker-cleanup-volumes]$ sudo sh docker-cleanup-volumes.sh docker-cleanup-volumes.sh: line 61: $1: unbound variable
commented # the lines of the --dry-run option and this script works just fine!
docker@boot2docker:~$ sh docker-cleanup-volumes.sh docker-cleanup-volumes.sh: line 10: syntax error: unexpected "(" docker@boot2docker:~$