2

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:

networks:
  custom:
    driver: "bridge"
    ipam:
      driver: default
      config:
        - subnet: 10.10.10.0/16
          gateway: 10.10.10.1
        - subnet: 100.100.100.0/16
          gateway: 100.100.100.1

But I get the error:

Creating network "docker-setup-test_custom" with driver "bridge"
ERROR: Pool overlaps with other one on this address space
5
  • 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
0

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

https://docs.docker.com/compose/networking/#specify-custom-networks

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.