Skip to content

Add daemon options for Docker network subnets #21776

@dimaspivak

Description

@dimaspivak

Output of docker version:

Client:
 Version:      1.10.1
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   9e83765
 Built:        Thu Feb 11 19:27:08 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.10.1
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   9e83765
 Built:        Thu Feb 11 19:27:08 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 14
 Running: 9
 Paused: 0
 Stopped: 5
Images: 7
Server Version: 1.10.1
Storage Driver: aufs
 Root Dir: /data/docker/aufs
 Backing Filesystem: xfs
 Dirs: 63
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Plugins: 
 Volume: local
 Network: null host bridge
Kernel Version: 3.13.0-74-generic
Operating System: Ubuntu 14.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 120.1 GiB
Name: my-machine-hostname
ID: PN5G:4THA:2ZTC:OF6B:BNMQ:MSB7:JCUK:TBAW:3ZRP:ARMT:ABWV:YFYU
WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):
Happens on physical hosts and AWS/GCP

Steps to reproduce the issue:

  1. Set --bip=... when starting a Docker daemon (e.g. to avoid conflicts with other things on your company's LAN). I set mine to 192.168.1.0/16.
  2. Create a Docker bridge network (e.g. docker network create ...).
  3. Run docker network inspect against the new network and look at the subnet.

Describe the results you received:
The subnet on my machine is, for example, 172.19.0.0/16

Describe the results you expected:
Seeing as how I specified a default bridge IP for the daemon, I'd have expected that to be propagated to the bridge driver.

Additional information you deem important (e.g. issue happens only occasionally):
An obvious workaround is to use --subnet when creating the bridge networks. The problem, though, is that this can lead to race conditions if networks are started in multiple threads. That is, I end up writing a lot of exception handling for cases of overlapping subnet ranges, but it seems more straightforward for Docker to handle this (as it already does on the default subnet it seems to hardcode).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/networkingNetworkingkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.kind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shinystatus/acceptedversion/1.10

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions