docker migration of containers from one subnet to another

  dns, docker, networking, nginx, traefik

Hello I would need to explain following situation in docker world.

I have several containers in a subnet network with Primary DNS server (can be default docker DNS server). I need to create containers in another subnet network with different Primary DNS server and with minimal downtime.

I created new docker network and custom Bind9 DNS server in docker. I created DNS record and I created container with flag –ip= –dns= and –ip= –dns=

DNS record contains lines with domain names and ip addresses above.

My question: How can I created loadbalancer (or any other solution) that will split traffic to old containers and to new ones ? My idea was to create nginx load balancer that will split traffic between old containes and new ones and I will configure domain names for new containers

Source: Docker Questions