docker-gc icon indicating copy to clipboard operation
docker-gc copied to clipboard

Getting script to work with /bin/sh

Open jasonm-makerbot opened this issue 10 years ago • 3 comments

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.

jasonm-makerbot avatar Oct 22 '15 16:10 jasonm-makerbot

I can confirm that this works well inside of docker-machine -- there's nothing in the script that really "needs" bash.

extemporalgenome avatar Nov 06 '15 21:11 extemporalgenome

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

konstruktoid avatar Nov 29 '15 19:11 konstruktoid

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.

mattnworb avatar Dec 01 '15 20:12 mattnworb