Docker run with --bip option fails


Docker version:
Version: 1.12.2
API version: 1.24
Go version: go1.7
Git commit: 8eab29e
OS/Arch: linux/amd64

Docker info:
Storage Driver: btrfs
Build Version: Btrfs v4.1.2+20151002
Library Version: 101
Logging Driver: json-file
Cgroup Driver: cgroupfs
Volume: local
Network: host bridge null overlay
Swarm: inactive
Runtimes: oci runc
Default Runtime: oci
Security Options: apparmor
Kernel Version: 4.4.21-68-default
Operating System: SUSE Linux Enterprise Server 12 SP2
OSType: linux
Architecture: x86_64
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false

docker config
DOCKER_OPTS="–insecure-registry= –bip= --ip-forward=false --log-level=debug"

docker run -it --rm busybox /bin/sh

It fails with the following error:

docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:334: running prestart hook 0 caused "error running hook: exit status 1, stdout: , stderr: time="2016-11-27T20:51:30Z " level=fatal msg=“failed to set gateway while updating gateway: route for the gateway could not be found: invalid argument”.

Note that using --bip= (which is default) or if I remove the --bip option shows no such issue.

Anyone has seen this or has a suggestion?


Irrespective of your actual network configuration Linux seems to always return lo for routes to IPs in the network

# ip route get
local dev lo src 
    cache <local> 

# ip addr show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever

# ip addr show br-d782a72d3a79
93: br-d782a72d3a79: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:9e:38:fb:27 brd ff:ff:ff:ff:ff:ff
    inet brd scope host br-d782a72d3a79
       valid_lft forever preferred_lft forever