I'm struggling with Docker Compose (version 2 or 3). I'm trying to add multiple subnets, so various services can reach each other, but get assigned IPv4 addresses from different subnets.

This is my current configuration:

    driver: "bridge"
      driver: default
        - subnet:
        - subnet:

But I get the error:

Creating network "docker-setup-test_custom" with driver "bridge"
ERROR: Pool overlaps with other one on this address space
  • You can't have a subnet that overlaps another subnet. – Michael Hampton May 3 '19 at 11:59
  • But they don't overlap? – Alfred Balle May 3 '19 at 12:23
  • It can't overlap any other Docker network, including ones previously created. – Michael Hampton May 3 '19 at 12:49
  • 2
    Ah, found some old networks in docker network list. Thank you. – Alfred Balle May 3 '19 at 12:53
  • Now I'm getting a new error: ERROR: bridge driver doesn't support multiple subnets. – Alfred Balle May 3 '19 at 12:53

You can specify the network config as specified in the documentation:


Otherwhise I believe all containers in the same docker compose can communicate without network config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.