Skip to content

Instantly share code, notes, and snippets.

@bonndan
Last active August 29, 2015 14:14
Show Gist options
  • Save bonndan/49f115b05145bf242036 to your computer and use it in GitHub Desktop.
Save bonndan/49f115b05145bf242036 to your computer and use it in GitHub Desktop.
docker-local-dns
#!/bin/bash
#
# see https://github.com/iverberk/docker-spy
#
boot2docker up
BOOT2DOCKER_IP="$(boot2docker ip)"
DOCKER_IP_BRIDGE="172.17.42.1"
DNS_DOMAIN="local-dev.leanix.net"
mkdir -p /etc/resolver
touch /etc/resolver/local-dev.leanix.net
echo "nameserver ${DOCKER_IP_BRIDGE}" > /etc/resolver/local-dev.leanix.net
route -n add -net 172.17.0.0 ${BOOT2DOCKER_IP}
docker run --name docker_spy -p 53:53/udp -p 53:53 -v /var/run/docker.sock:/var/run/docker.sock iverberk/docker-spy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment