英文:
Location CNI plugin configuration(s) of the Docker Desktop with WSL2 network infrastructure?
问题
在使用 Edgeshark 开源工具调查在 Windows 上使用 WSL2 运行的 Docker Desktop 时,我获得了以下容器工作负载的网络拓扑图:
请注意,这是一个 Docker-in-containerd 设置,因此 Docker 引擎位于 containerd 容器内,在 containerd 的 services.linuxkit
命名空间中。
现在,我“怀疑” Docker Desktop 可能会使用 CNI 插件与 containerd 一起为其托管的容器进行网络连接,例如 docker1
-eth0
和 services1
-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:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论