Increase limit of 30 docker networks in a clean way

I am successfully running CoreOS on my Intel NUC and it runs very stable and smooth

Time to time i am trying new things and adding containers/stacks via Portainer

As i could not add any more stacks/containers because of the limit of 30 available networks i am now wondering

  • Why is this limit so low and are there so less people running this amount of networks?
  • Trying this i would need to utilize a currently not available file in /etc/docker/daemon.json
  1. What is the “cleanest” way to increase the max amount of docker-networks?
  2. I do not want to crash my simple but fine running system

I have no knowledge in re-provisioning
Just using a relatively stock setup, with local mouting my bind-mount docker volumes in /var/home/core...

Creating a file like this would result in the file being lost after next reboot?

1 Like

I haven’t really run into this problem before, but can you try creating that /etc/docker/daemon.json file with the right contents (maybe on a system you don’t care about first) and restarting the docker daemon to see if it has the desired effect.

Any files created under /etc will persist across reboots.

1 Like

Thank you very much and sorry for the delay

I think the next time i want to start a docker container i will try solutions in the following order

  1. Use docker-compose networking options to create additional docker networks not using default IP-range Networking in Compose | Docker Docs

  2. Changing the docker daemon.json as you proposed

Any files created under /etc will persist across reboots.

In fact i did really forget that files in /etc will be persistent → Perfect

OK, i tested it and it works

  1. cd /etc/docker
  2. sudo touch daemon.json
  3. vi daemon.json
  4. Insert & Safe
{
   "default-address-pools": [
        {
            "base":"172.17.0.0/12",
            "size":16
        },
        {
            "base":"192.168.0.0/16",
            "size":20
        },
        {
            "base":"10.99.0.0/16",
            "size":24
        }
    ]
}
  1. sudo systemctl restart docker

Now i was able to deploy more Stacks
Im not a networking genious but the Source Article tells me that i should now have additional 255 networks

  • This persisted also after boot
  • I could reach the port of a Stack/Docker-Compose i started → No networking issues so far

I will add this to my ToDo-List when setting up a CoreOS System

Still … I find it weird to have standard-settings limiting this to such a low number by default

I would say that most systems don’t need 255 networks, which is why it isn’t the default today. In each network there are many different IPs that can be allocated.

1 Like