[컴] Docker의 bridge networks

 도커 브릿지 / 도커 브리지 / 네트워크

Docker의 bridge networks

네트워킹 측면에서 bridge network는 네트워크 segment 간에 트래픽을 전달하는 link layer 장치이다.

  • Docker는 소프트웨어 bridge를 사용한다.
  • docker 의 bridge network는 동일한 bridge network에 연결된 컨테이너(container)가 통신할 수 있도록 해준다.
  • bridge network들은 같은 Docker deamon host에서 실행되는 container 들에 적용된다.
  • 도커를 시작하면 기본 bridge network가 자동으로 생성되고
  • 별도로 지정하지 않는 한 새롭게 시작된 컨테이너들은 이 네트워크에 연결된다.
  • 사용자 정의 bridge network를 만들 수도 있다. 사용자 정의 bridge network는 기본 bridge network보다 우선순위를 갖는다.
C:\a\tmp>docker network ls
NETWORK ID     NAME                  DRIVER    SCOPE
f71bc0f83eb0   bridge                bridge    local
3f89c3e5e630   host                  host      local
6715464c7ff1   none                  null      local
C:\a\tmp>

bridge network 외부와의 통신

  • 해당 bridge network에 연결되지 않은 컨테이너와는 분리된다.
  • Docker bridge driver 는 host machine 에 자동으로 rules 를 설치한다. 그래서 다른 bridge network 에 있는 container 들은 서로 직접적으로 통신할 수 없다.
  • 서로 다른 Docker deamon hsot에서 실행되는 컨테이너 간의 통신을 위해서는 OS level에서 라우팅을 관리하거나 overlay network(docker swarm 같은) 를 사용할 수 있다.

원문

In terms of networking, a bridge network is a Link Layer device which forwards traffic between network segments. A bridge can be a hardware device or a software device running within a host machine’s kernel.

In terms of Docker, a bridge network uses a software bridge which allows containers connected to the same bridge network to communicate, while providing isolation from containers which are not connected to that bridge network. The Docker bridge driver automatically installs rules in the host machine so that containers on different bridge networks cannot communicate directly with each other.

Bridge networks apply to containers running on the same Docker daemon host. For communication among containers running on different Docker daemon hosts, you can either manage routing at the OS level, or you can use an overlay network.

When you start Docker, a default bridge network (also called bridge) is created automatically, and newly-started containers connect to it unless otherwise specified. You can also create user-defined custom bridge networks. User-defined bridge networks are superior to the default bridge network.

댓글 없음:

댓글 쓰기