10

I am trying to configure docker-compose to use different network range by default, so I follow instructions from https://github.com/moby/moby/pull/29376

However, I get following error:

unable to configure the Docker docker daemon with file /etc/docker/daemon.json: the following directives don't match any configuration option: default-address-pools

Here is the content of daemon.json - it is the sample taken from the #29376.

{
  "default-address-pools": [
    {
      "scope": "local",
      "base": "172.80.0.0/16",
      "size": 24
    },
    {
      "scope": "global",
      "base": "172.90.0.0/16",
      "size": 24
    }
  ]
}

Please advise.

My env:

# uname -a
Linux gfn-classroom 4.4.0-109-generic #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 
2018 x86_64 x86_64 x86_64 GNU/Linux

# docker --version
Docker version 17.12.0-ce, build c97c6d6

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
Tibebes. M
  • 6,940
  • 5
  • 15
  • 36
Moisei
  • 1,162
  • 13
  • 30
  • Note that 172.80.0.0/16 is not an address in a private space. Following youe config, your containers are prevented from communicating with that network in the real world. – Michael Bisbjerg Jan 17 '19 at 13:05

2 Answers2

13

This is merged in https://github.com/moby/moby/pull/36396 and (hopefully) will be available in 18.06. [Reference]

Also note changing default address pool is also available as a cli argument, e.g.:

/usr/bin/dockerd -H ... --default-address-pool base=172.29.0.0,size=16
Taha Jahangir
  • 4,774
  • 2
  • 42
  • 49
2

Pull-request https://github.com/moby/moby/pull/29376 was closed, not merged, so that feature is not available (yet) in Docker

thaJeztah
  • 27,738
  • 9
  • 73
  • 92