Docker Community Forums

Share and learn in the Docker community.

Docker and default network addresses and ranges

I have a set of containers I run with many small networks instead of a small number of large networks and use docker-compose to bring up the containers. Docker-compose creates or helps to create networks when they don’t exist. When a network is created, it uses a large IP range. In the example below, the subnet I have two questions:

  1. /20 is way too large. Is there any configuration in docker that specifies the default CIDR range? Can I also specifiy a different subnet?

  2. I have other devices on 192.168.1.###, 192.168.10.###, and a few others. Is there any to prevent docker from using certain address ranges?

    $ docker network inspect app_midtier_db
    “Name”: “app_midtier_db”,
    “Id”: “6814d4d68b8f3e990a04253ee21954a938751b5e3a85562190b98fc9917efa74”,
    “Created”: “2019-03-30T15:33:32.441205777-04:00”,
    “Scope”: “local”,
    “Driver”: “bridge”,
    “EnableIPv6”: false,
    “IPAM”: {
    “Driver”: “default”,
    “Options”: null,
    “Config”: [
    “Subnet”: “”,
    “Gateway”: “”

    Thank you for your help.