使用WSL 2引擎运行docker桌面时使用的docker-desktop-data发行版是什么 [英] What is the docker-desktop-data distro used for when running docker desktop with the WSL 2 engine

查看:127
本文介绍了使用WSL 2引擎运行docker桌面时使用的docker-desktop-data发行版是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在具有Hyper-V的Windows上运行docker桌面时,我有一个名为DockerDesktopVM的VM,我的Linux VM在其中运行其容器的情况下运行.

When running docker desktop on Windows with Hyper-V I have a single VM called DockerDesktopVM where my Linux VM is running with it's containers inside.

但是,当我使用WSL引擎运行docker桌面时,我看到它创建了2个WSL发行版.

However when I run docker desktop with the WSL engine I see that it creates 2 WSL distros.

  1. docker-desktop
  2. docker-desktop-data

我可以像其他任何发行版一样装入docker-desktop发行版.

I can shell into the docker-desktop distro like I would any other distro.

但是尝试对docker-desktop-data做同样的事情只会让我反感.

But trying to do the same to docker-desktop-data just bounces me out.

所以我的问题是docker-desktop-data发行版有什么用途,为什么它与docker-desktop发行版分开存在?显然,该名称暗含数据,但是什么是特定数据?为什么我不能像其他任何人一样跳入发行版?

So my question is what is the docker-desktop-data distro for and why does it exist separately from the docker-desktop distro? Clearly the name implies data but what specific data and why can't I jump into the distro as I would any other?

推荐答案

docker-desktop-data发行版由docker-desktop发行版用作容器映像等的后备存储.当docker在Hyper-V下运行时,通过在Hyper-V映像中安装VHD可以达到相同的结果,但WSL2则无法实现.

The docker-desktop-data distro is used by the docker-desktop distro as the backing store for container images etc. When docker is run under Hyper-V the same result is achieved by mounting a VHD in the Hyper-V image but this isn't possible with WSL2.

引述引入新wsl2后端的docker博客:

这将为您创建2个WSL发行版:

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

从高层的角度来看,引导发行版本质上是取代了Hyper-V,而数据存储发行版取代了我们以前已附加到VM.

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.

引导发行版使用其自己的根目录创建一个Linux名称空间基于我们前面提到的相同2个iso文件的文件系统(不是完全正确,但足够接近),并使用数据存储发行版作为容器映像等的后备存储,而不是VHD(WSL 2可以目前不允许我们附加其他VHD,因此我们可以利用跨发行版).

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).

博客文章很好地介绍了wsl上的docker的工作原理.

The blog post is a great introduction to how docker on wsl works.

这篇关于使用WSL 2引擎运行docker桌面时使用的docker-desktop-data发行版是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆