Sunday, July 19, 2015

Docker networking 101

http://www.dasblinkenlichten.com/docker-networking-101-host-mode/

There are really 4 docker ‘provided’ network modes in which you can run containers…
Bridge mode – This is the default, we saw how this worked in the last post with the containers being attached to the docker0 bridge.
Host mode – The docker documentation claims that this mode does ‘not containerize the containers networking!’.  That being said, what this really does is just put the container in the hosts network stack.  That is, all of the network interfaces defined on the host will be accessible to the container.  This one is sort of interesting and has some caveats but we’ll talk about those in greater detail below.
Mapped Container mode – This mode essentially maps a new container into an existing containers network stack.  This means that while other resources (processes, filesystem, etc) will be kept separate, the network resources such as port mappings and IP addresses of the first container will be shared by the second container.
None – This one is pretty straight forward.  It tells docker to put the container in its own network stack but not to do configure any of the containers network interfaces.  This allows for you to create custom network configuration which we’ll talk about more in a later post.
Keep in mind that all these modes area applied at the container level so we can certainly have a mix of different network modes on the same docker host.


1 comment:

radha said...
This comment has been removed by the author.