Hey guys, I was happily running 44 docker containers for a while on Debian host. Today I tried to add a new service (uptime-kuma) using portainer stacks, but I got this error:
Error response from daemon: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network
Quick google led me to this link where I found possible problem with max number of docker networks. I did docker network prune
, it removed 5 networks that were not in use and viola, uptime-kuma is working now!
Am I reaching the limit? What to do if I need 10 more services on the same host? I bet I saw some people in this community running many more services
Only if there was IPv6: https://docs.docker.com/config/daemon/ipv6/
Just run all your containers with IPv6 randomly generated prefixes and this won’t ever be a problem, you’ll also get more IP spacing than you’ll ever require. Then use your reverse proxy to convert between the “public” IPv4 space and the internal docker IPv6 networks.
Another option is to reduce the size of your IPv4 pools like this guy described.