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: 20.21.10.100
  app2:
    image: app
    networks:
        default:
            ipv4_address: 20.21.10.101
networks:
  default:
    driver: bridge
    ipam:
      config:
          - subnet: 20.21.10.0/24

It’s ok when I am running 1 instance of this compose. but when I run another one it gave me this error:

  • GUI's with Docker
  • how to get docker container to read from stdin?
  • Missing Carriage Return in Docker for Mac Containers
  • How do I run a node container on AWS ECS without exiting
  • docker redis -Can't open the log file: No such file or directory
  • Keep MySQL data inside Docker container
  • 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.

  • Permission denied: docker-machine create
  • standard_init_linux.go:178: exec user process caused “no such file or directory”
  • Getting pygame running in docker
  • fig up fails with error “create_container() takes at least 2 arguments”
  • Multiple docker containers of same image and memory usage
  • socket failed Too many open files error Docker
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.