Skip to content

Instantly share code, notes, and snippets.

@pcornier
Created September 21, 2017 07:01
Show Gist options
  • Save pcornier/e309769fcd9f6a91b2efb7829fd98365 to your computer and use it in GitHub Desktop.
Save pcornier/e309769fcd9f6a91b2efb7829fd98365 to your computer and use it in GitHub Desktop.
Auto update docker DNS with reverse proxy
#!/bin/bash
IP=$(nmcli dev show wlp4s0 | grep DNS | grep -o "\w*\.\w*\.\w*\.\w*" | head -n 1)
sed -i "s/--dns=\w*\.\w*\.\w*\.\w*/--dns=$IP/" /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl restart docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment