Reputation: 6859
I read document about docker
network mode.
there display there are docker0
and eth1
on Host.
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
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.
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 theDOCKER_OPTS
in docker configuration file explicitly specifies to use the other network thandocker0
bridge, in this case you could use–net=bridge
with docker run command to connect the containers to thedocker0
bridge.
See also "What is the relation between docker0
and eth0
?"
Upvotes: 5