One of the good (and bad) features of using Docker and docker-compose is it’s ability to spin up virtual networks for your container stack. This encourages application isolation, and clear thinking about what network ports you need to expose from and between your containers.
By default, Docker allocates a /16 subnet from the 172.[17-32].0.0 range for their network segments. Unfortunately, we use this range extensively in our corporate network. It turns out many other people do too.
Various bug reports have been open about this since 2016, and even a Pull Request from December 2016, but finally a patch has made it’s way into Docker 18.06 release.
With the Docker 18.06 release, this functionality is now available, although you can’t configure it using the normal methods in the Toolbox GUI on the Docker client on MacOS.
But you can still make it work! As one Docker For Mac user has posted:
You can bypass the GUI for configuring daemon.json by editing ~/.docker/daemon.json. Restart Docker will use your default address pools but the GUI will continue to complain.
The ability to edit daemon.json was released with 17.09 https://docs.docker.com/docker-for-mac/release-notes/#docker-community-edition-17090-ce-mac33-2017-10-03
Here’s my daemon.json:
$ cat ~/.docker/daemon.json
{
"debug" : true,
"bip" : "192.168.251.1/24",
"experimental" : true,
"default-address-pools": [
{
"scope": "local",
"base": "172.30.0.0/16",
"size": 24
}
]
}
We’ve tried it and it works perfectly. No more overlapping subnets!
How we can help
More from the blog
Serial: A better USB Serial program for OSX
12 May 2018
Serial is a new(ish) Serial Terminal Emulator for OSX that makes the process of connecting to a serial device… easy.
Read moreWindows 3.1 is not dead!
11 Apr 2018
Feeling like you need to regress to your Windows 3.1 days? The Windows 3.1 File Manager lives! In a throw back to the past, Microsoft …
Read more
Securing your business in the AI Era
06 May 2026
Join Andrew Yager and Phil Meyer from Catalyst 345 as they talk about how to use the Microsoft Ecosystem to deliver Secure AI in your …
Read more