Created
June 30, 2015 22:34
-
-
Save moofish32/7a4a21774f93e8454128 to your computer and use it in GitHub Desktop.
Boot2Docker Fix My DNS!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOCKER_BRIDGE=`boot2docker ssh ifconfig docker0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` | |
echo "Setting docker dns to the docker bridge @ $DOCKER_BRIDGE" | |
boot2docker ssh sudo "ash -c \"echo EXTRA_ARGS=\'--dns $DOCKER_BRIDGE --dns $(scutil --dns | awk -F ': ' '/nameserver/{print $2}' | head -1) --dns-search service.consul\' > /var/lib/boot2docker/profile\"" | |
boot2docker restart | |
echo "... b2d restarted." |
so....run after boot2docker starts?
Ideally yes after it's started you can see it will restart it of course. I typically run this anytime I switch VPN's
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
all credit to @bkono