user7693832
user7693832

Reputation: 6859

What's the `docker0` there?

I read document about docker network mode.

there display there are docker0 and eth1 on Host.

enter image description here

I have a question about it: what's the docker0? is it an interface or bridge? if is an interface, it should be have a IP address which can communicate with 172.17.0.2, right?

Upvotes: 3

Views: 6982

Answers (1)

VonC
VonC

Reputation: 1329542

You can see for instance docker0 described in this article:

The docker0 bridge is virtual interface created by docker, it randomly chooses an address and subnet from the private range defined by RFC 1918 that are not in use on the host machine, and assigns it to docker0.

All the docker containers will be connected to the docker0 bridge by default, the docker containers connnected to the docker0 bridge could use the iptables NAT rules created by docker to communicate with the outside world.

bridge

By default Docker will attach all containers to the docker0 bridge, so you do not need to specify any additional flag with docker run command to connect the docker containers to the docker0 bridge, unless the DOCKER_OPTS in docker configuration file explicitly specifies to use the other network than docker0 bridge, in this case you could use –net=bridge with docker run command to connect the containers to the docker0 bridge.

See also "What is the relation between docker0 and eth0?"

Upvotes: 5

Related Questions