David K. Bainbridge | 119a3b0 | 2016-06-16 18:10:30 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | PROG=$(basename $0) |
| 4 | |
| 5 | HELP=$(echo "$*" | grep "\-h" | wc -w) |
| 6 | |
| 7 | if [ $HELP -ne 0 ]; then |
| 8 | echo "usage: $PROG <remote-registry>..." |
| 9 | exit 1 |
| 10 | fi |
| 11 | |
| 12 | OUT=$(tempfile) |
| 13 | head -1 /etc/default/docker >> $OUT |
David K. Bainbridge | 59241a2 | 2016-06-17 14:46:42 -0700 | [diff] [blame^] | 14 | echo "" >> $OUT |
David K. Bainbridge | 119a3b0 | 2016-06-16 18:10:30 -0700 | [diff] [blame] | 15 | while [ $# -gt 0 ]; do |
| 16 | echo "DOCKER_OPTS=\"\$DOCKER_OPTS --insecure-registry $1\"" >> $OUT |
| 17 | shift |
| 18 | done |
| 19 | |
| 20 | sudo cp $OUT /etc/default/docker |
| 21 | rm $OUT |
| 22 | |
| 23 | sudo service docker restart |