Docker Community Forums

Share and learn in the Docker community.

How to join new containers from docker compose to a running container network?

Hi, I m noob in docker container / compose etc.

I already have a container runnning whose network id is 93aa3d2078761e7f93d103850d2942ea560837ca4894a0d2ed7f10a58aa1a99e

if I spin below docker compose up

docker-compose.yml

version: "3"
  coredns_upstream:
    image: "coredns/coredns"
    volumes:
      - "./coredns/:/etc/coredns/"
    command: -conf /etc/coredns/coreconfig-up
    restart: unless-stopped
    container_name: coredns_up
    networks:
      coredns:
        ipv4_address: 172.10.10.100

  coredns_downstream:
    image: "coredns/coredns"
    ports:
      - "853:853/tcp"
    volumes:
      - "./coredns/:/etc/coredns/"
    command: -conf /etc/coredns/coreconfig-down
    restart: unless-stopped
    container_name: coredns_down
    links:
      - 'pihole'
    networks:
      coredns:
        ipv4_address: 172.10.10.101