Files
weave-scope/docker/entrypoint.sh
Tom Wilkie d9b54ba60b Yet More Plumbing for multi-host setup.
- Move peers from flags to args in the app
- Allow users to specify peers as IPs and hostname, both with and without ports
- Allow users to specify peers on ./scope launch, and plumb that through entrypoint.sh and run-app
- Improce ./scope usage text
- Add brief document explaining how to cluster Scope
2015-06-01 12:29:01 +00:00

43 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
usage() {
echo "$0 --dns <IP> --hostname <NAME> --searchpath <SEARCHPATH>"
exit 1
}
# This script exists to modify the network settings in the scope containers
# as docker doesn't allow it when started with --net=host
while true; do
case "$1" in
--dns)
[ $# -gt 1 ] || usage
DNS_SERVER="$2"
shift 2
;;
--searchpath)
[ $# -gt 1 ] || usage
SEARCHPATH="$2"
shift 2
;;
*)
break
;;
esac
done
if [ -n "$DNS_SERVER" -a -n "$SEARCHPATH" ]; then
echo "domain $SEARCHPATH" >/etc/resolv.conf
echo "search $SEARCHPATH" >>/etc/resolv.conf
echo "nameserver $DNS_SERVER" >>/etc/resolv.conf
fi
# End of the command line can optionally be some
# addresses of probes to connect to, for people not
# using Weave DNS. We stick these in /etc/weave/probes
# for the run-app script to pick up.
MANUAL_PROBES=$@
mkdir -p /etc/weave
echo "$MANUAL_PROBES" >/etc/weave/probes
exec /sbin/runsvdir /etc/service