From 1601366cb6bfb9671ec28ced0bf88d11049264d3 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Mon, 8 Apr 2013 18:16:58 -0700 Subject: [PATCH] Make it more clear when Docker fails to allocate a free IP range for its bridge --- network.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/network.go b/network.go index f6804cfcd7..9164c1d72e 100644 --- a/network.go +++ b/network.go @@ -111,6 +111,8 @@ func checkRouteOverlaps(dockerNetwork *net.IPNet) error { } func CreateBridgeIface(ifaceName string) error { + // FIXME: try more IP ranges + // FIXME: try bigger ranges! /24 is too small. addrs := []string{"172.16.42.1/24", "10.0.42.1/24", "192.168.42.1/24"} var ifaceAddr string @@ -127,7 +129,7 @@ func CreateBridgeIface(ifaceName string) error { } } if ifaceAddr == "" { - return fmt.Errorf("Impossible to create a bridge. Please create a bridge manually and restart docker with -br ") + 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) } else { Debugf("Creating bridge %s with network %s", ifaceName, ifaceAddr) }