Skip to content

Instantly share code, notes, and snippets.

@zoomix
zoomix / boot2docker_network.sh
Last active August 29, 2015 14:08
Change your /etc/hosts based on your running containers hostnames
#!/bin/bash
echo Starting boot2docker if not already started
boot2docker status || boot2docker up
export the_ip=$(boot2docker ip 2>&1 | egrep -o "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*")
export old_route_ip=$(netstat -r | grep 172.17 | egrep -o "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*")
echo Found boot2docker ip $the_ip
if [ "$the_ip" == "" ]; then
echo Could not find the ip of boot2docker.. =/