Run two docker compose with same static ip on a host
I have a docker compose file like this:
version: '2' services: app1: image: app networks: default: ipv4_address: 22.214.171.124 app2: image: app networks: default: ipv4_address: 126.96.36.199 networks: default: driver: bridge ipam: config: - subnet: 188.8.131.52/24
It’s ok when I am running 1 instance of this compose. but when I run another one it gave me this error:
ERROR: cannot create network 58610eba91b8ea064127ee6e58753bde6bc11af81ee05eccb815fd8dfc0e6688 (br-58610eba91b8): conflicts with network 43328a225317ee882853da87adc07df70158d6e2673335bceaf606465a1c6f5e (br-43328a225317): networks have overlapping IPv4
In fact I want my apps see each other with a specific ip in each group and this groups be isolated from each other.
I wonder if docker provides a solution for isolating networks from each other on a single host so two networks can have same subnet.