docker-gc
docker-gc copied to clipboard
Getting script to work with /bin/sh
Getting script to work with /bin/sh so you can use it on docker-machine or boot2docker as they are minimal distributions that do not contain bash. The script still works when run by bash however.
I can confirm that this works well inside of docker-machine -- there's nothing in the script that really "needs" bash.
Even if you change /bin/bash to /bin/sh, the script still contains some bashism:
$ sudo dash docker-gc
docker-gc: 81: docker-gc: function: not found
$ sudo /bin/sh docker-gc
docker-gc: 81: docker-gc: function: not found
$ shellcheck docker-gc | grep -c -e 'SC.*:'
52
There were functions added to docker-gc after this PR was created, so while this merges cleanly the result is not bash compatible any more.