Docker Can Only Create 31 Default Networks

Jarek Lipski
Sep 4, 2016 · 1 min read

I have just learned that Docker has a limit of 31 networks for a default bridge network driver on a single machine:

~$ docker network create test1
289c3909adbc9f79cdc7ce640d66904088cdff72fbf611cdd124c9681aa0a0e7
~$ docker network create test2
567eb19074ba8d76df7f6b65887a3e75117b0cb748afaa5f3bfe3a750ff9f627
...~$ docker network create test31
f4ec74b0f34b7f7961676e48e53abbf4f5394e18f6a750f98f43091cb2f0d0dd
~$ docker network create test32
Error response from daemon: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network

This is due to the fact that it uses a hardcoded list of broad network ranges for a bridge network driver: 172.17-31.x.x/16 and 192.168.x.x/20 (Update: it’s now possible to customize the ranges in Docker daemon configuration). For an overlay network driver, 64K networks can be created. If you want to know the implementation details, please look into Docker libnetwork’s ipamutils and allocator.

The only solution to circumvent this limitation seems to be manually specifying subnet ranges for each created network (please see Docker network create subnet option and Docker Compose network configuration reference):

docker network create --subnet=192.168.1.0/24 test1

In Puffin, which needs to create a separate network for each application, I implemented a simple address allocator.

Update: https://serverfault.com/questions/916941/configuring-docker-to-not-use-the-172-17-0-0-range


Originally published at loomchild.net on September 4, 2016.

Jarek Lipski

Written by

Full-Stack Developer / Agilist / Free and Open Source Software Fan.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade