Fix Docker IP detection with different ifconfig output formats (#4376)

This commit is contained in:
Yen Chi Hsuan 2017-03-30 04:34:09 +08:00 committed by Brad Warren
parent 67e11ae1d8
commit 6fb78dab67

View file

@ -12,5 +12,7 @@ fi
cd ${BOULDERPATH}
FAKE_DNS=$(ifconfig docker0 | grep "inet addr:" | cut -d: -f2 | awk '{ print $1}')
[ -z "$FAKE_DNS" ] && FAKE_DNS=$(ifconfig docker0 | grep "inet " | xargs | cut -d ' ' -f 2)
[ -z "$FAKE_DNS" ] && echo Unable to find the IP for docker0 && exit 1
sed -i "s/FAKE_DNS: .*/FAKE_DNS: ${FAKE_DNS}/" docker-compose.yml
docker-compose up -d