Does a docker container have its own TCP/IP stack?

前端 未结 1 1913
眼角桃花
眼角桃花 2021-02-01 15:22

I\'m trying to understand what\'s happening under the hood to a network packet coming from the wire connected to the host machine and directed to an application inside a Docker

相关标签:
1条回答
  • 2021-02-01 16:06

    The network stack, as in "the code", is definitely not in the container, it's in the kernel of which there's only one shared by the host and all containers (you already knew this). What each container has is its own separate network namespace, which means it has its own network interfaces and routing tables.

    Here's a brief article introducing the notion with some examples: http://blog.scottlowe.org/2013/09/04/introducing-linux-network-namespaces/ and I found this article helpful too: http://containerops.org/2013/11/19/lxc-networking/

    I hope this gives you enough pointers to dig deeper.

    0 讨论(0)
提交回复
热议问题