Skip to content

Instantly share code, notes, and snippets.

@ejoubaud
Last active February 2, 2016 20:40
Show Gist options
  • Save ejoubaud/aa6f1eab57832d3ada9c to your computer and use it in GitHub Desktop.
Save ejoubaud/aa6f1eab57832d3ada9c to your computer and use it in GitHub Desktop.
Docker-machine: Update domain name in /etc/hosts, a bash/zsh one-liner
mark="# DOCKER_MACHINE:" && sudo sed -i '' "/$mark/d" /etc/hosts && docker-machine ls -q | while read m; do echo "$(docker-machine ip $m) $m.docker ${mark} $m" | sudo tee -a /etc/hosts; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment