docker - 使用 WSL 2 引擎运行 docker 桌面时使用的 docker-desktop-data 发行版是什么

标签 docker windows-subsystem-for-linux docker-for-windows docker-desktop

当使用 Hyper-V 在 Windows 上运行 docker desktop 时,我有一个名为 DockerDesktopVM 的 VM,我的 Linux VM 在其中运行,其中包含容器。

DockerDesktopVM

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

  • docker 桌面
  • docker 桌面数据

  • enter image description here

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

    enter image description here

    但是尝试对 docker-desktop-data 做同样的事情只会让我失望。

    enter image description here

    所以我的问题是 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/

    相关文章:

    docker - 用于批处理作业的 swarm、kubernetes 或 mesos

    visual-studio-code - 带有 WSL2 的 VSCode - 由于对 ping 没有响应而延迟启动

    networking - Windows 10 bash tcpdump : socket: Invalid argument

    bash - chmod WSL (Bash) 不起作用

    docker - Windows版Docker-导出体积数据

    docker - Windows Server 2016 docker image 默认用户名/密码

    node.js - docker 中的多个 Nodejs Worker

    docker - Ingress如何决定他是否必须在http或https上公开kubernetes服务?

    docker-compose - 使用docker在windows容器中运行exe文件

    c - 无法登录 docker 容器 syslog 文件