Docker Desktop与WSL2网络基础设施的位置CNI插件配置?

huangapple go评论57阅读模式
英文:

Location CNI plugin configuration(s) of the Docker Desktop with WSL2 network infrastructure?

问题

在使用 Edgeshark 开源工具调查在 Windows 上使用 WSL2 运行的 Docker Desktop 时,我获得了以下容器工作负载的网络拓扑图:

Docker Desktop与WSL2网络基础设施的位置CNI插件配置?

请注意,这是一个 Docker-in-containerd 设置,因此 Docker 引擎位于 containerd 容器内,在 containerd 的 services.linuxkit 命名空间中。

现在,我“怀疑” Docker Desktop 可能会使用 CNI 插件与 containerd 一起为其托管的容器进行网络连接,例如 docker1-eth0services1-eth0 VETH “网络”。如果确实如此,我应该在哪里找到此设置的 CNI 插件配置?

英文:

Investigating Docker Desktop on Windows with WSL2 using the Edgeshark open source tool, I get the following network topology for the container workload:

Docker Desktop与WSL2网络基础设施的位置CNI插件配置?

Please note how this is a Docker-in-containerd setup, so the Docker engine lives inside a containerd container, in the services.linuxkit namespace of containerd.

Now I "suspect" that Docker Desktop might use CNI plugins with containerd to network its managed containers, such as the docker1-eth0 and services1 -eth0 VETH "networks". If this actually is the case, where can I find the CNI plugin configuration for this setup?

答案1

得分: 0

正如事实证明的那样,我们需要一种查看Docker引擎周围环境的方式,而查看它的方法是部署一个检查容器,如下所示:

docker run -it --rm --privileged --pid host alpine

接下来,我们可以通过/proc/1/root/的虫洞来查看周围环境;这会显示一个名为/proc/1/root/containers的目录,其中包含一个名为onboot的子目录。这里还有更多信息:

  • /proc/1/root/containers
    • onboot
      • ...
      • 004-docker-net
      • 005-docker-net-root
      • ...
    • services
      • ...

004-docker-net/runtime.json包含有关(网络)接口的“部分”信息:

    "interfaces": [
        {
            "name": "docker0",
            "add": "veth",
            "peer": "docker1",
            "createInRoot": false
        }
    ],

因此,在这里并没有使用“传统”的CNI插件配置,但Docker Desktop采取了自己的方式。

英文:

As it turns out, we need a way to look into the environment around the Docker engine, and a way to see it, is to deploy an inspection container as follows:

docker run -it --rm --privileged --pid host alpine

Next, we can look around via the wormhole of /proc/1/root/; this turns up a directory /proc/1/root/containers with an onboot sub-directory. There's more here:

  • /proc/1/root/containers
    • onboot
      • ...
      • 004-docker-net
      • 005-docker-net-root
      • ...
    • services
      • ...

004-docker-net/runtime.json contains a "section" about (network) interfaces:

    "interfaces": [
        {
            "name": "docker0",
            "add": "veth",
            "peer": "docker1",
            "createInRoot": false
        }
    ],

So, there is no "traditional" CNI plugin configuration used here, but Docker Desktop does its own thing.

huangapple
  • 本文由 发表于 2023年6月29日 01:32:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76575492.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定