Skip to content

Instantly share code, notes, and snippets.

@jonashelgemo
Created September 22, 2015 10:11
Show Gist options
  • Save jonashelgemo/1f896c6095535603f884 to your computer and use it in GitHub Desktop.
Save jonashelgemo/1f896c6095535603f884 to your computer and use it in GitHub Desktop.
#!/bin/zsh
#
set -x
container_id="$1"
container=$(docker inspect -f '{{ .Name }}' "$container_id" | sed "s/\///")
new_ip=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' "$container_id")
echo "host-record=$container.dev,$new_ip" > /usr/local/etc/dnsmasq.d/$container.dev.conf
sudo launchctl stop homebrew.mxcl.dnsmasq
sudo launchctl start homebrew.mxcl.dnsmasq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment