Browse code

Make it more clear when Docker fails to allocate a free IP range for its bridge

Solomon Hykes authored on 2013/04/09 10:16:58
Showing 1 changed files
... ...
@@ -111,6 +111,8 @@ func checkRouteOverlaps(dockerNetwork *net.IPNet) error {
111 111
 }
112 112
 
113 113
 func CreateBridgeIface(ifaceName string) error {
114
+	// FIXME: try more IP ranges
115
+	// FIXME: try bigger ranges! /24 is too small.
114 116
 	addrs := []string{"172.16.42.1/24", "10.0.42.1/24", "192.168.42.1/24"}
115 117
 
116 118
 	var ifaceAddr string
... ...
@@ -127,7 +129,7 @@ func CreateBridgeIface(ifaceName string) error {
127 127
 		}
128 128
 	}
129 129
 	if ifaceAddr == "" {
130
-		return fmt.Errorf("Impossible to create a bridge. Please create a bridge manually and restart docker with -br <bridgeName>")
130
+		return fmt.Errorf("Could not find a free IP address range for interface '%s'. Please configure its address manually and run 'docker -b %s'", ifaceName, ifaceName)
131 131
 	} else {
132 132
 		Debugf("Creating bridge %s with network %s", ifaceName, ifaceAddr)
133 133
 	}