当使用 Hyper-V 在 Windows 上运行 docker desktop 时,我有一个名为 DockerDesktopVM 的 VM,我的 Linux VM 在其中运行,其中包含容器。
但是,当我使用 WSL 引擎运行 docker desktop 时,我看到它创建了 2 个 WSL 发行版。
我可以像其他任何发行版一样进入 docker-desktop 发行版。
但是尝试对 docker-desktop-data 做同样的事情只会让我失望。
所以我的问题是 docker-desktop-data 发行版的用途是什么,为什么它与 docker-desktop 发行版分开存在?显然,名称暗示数据,但具体数据是什么,为什么我不能像其他任何人一样跳入发行版?
最佳答案
docker-desktop-data 发行版被 docker-desktop 发行版用作容器镜像等的后备存储。当 docker 在 Hyper-V 下运行时,通过在 Hyper-V 镜像中安装 VHD 可以实现相同的结果,但这不是使用 WSL2 是不可能的。
引用 the docker blog introducing the new wsl2 backend :
This will create 2 WSL distros for you:
Docker-desktop, which I’ll call the bootstrapping distro Docker-desktop-data, which I’ll call the data store distro
From a high level perspective, the bootstrapping distro essentially replaces Hyper-V, while the data store distro replaces the VHD that we previously attached to the VM.
The bootstrapping distro creates a Linux namespace with its own root filesystem based on the same 2 iso files we mentioned earlier (not entirely true, but close enough), and use the data-store distro as the backing store for container images etc. instead of a VHD (WSL 2 does not allow us to attach additional VHD at the moment, so we leverage cross-distro mounts for that).
这篇博文很好地介绍了 docker on wsl 的工作原理。
关于docker - 使用 WSL 2 引擎运行 docker 桌面时使用的 docker-desktop-data 发行版是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61396989/