应用程序分层

Docker

要安装 App Layering 服务,您需要将设备部署到虚拟机管理程序上的虚拟机。

如何安装 WSL 和 Docker

这些说明适用于所有 App Layering 图像类型,但主要用于非持久性 VDI 桌面的完整 UserLayer 部署。 请参阅 的相关指导,针对旧版本 WSL的手动安装步骤。 对于应用程序分层,这些说明将为已部署的虚拟机 VDI 池中的域用户提供 WSL 和 Docker 作为基础。

尝试使用 WSL 和/或 Docker 的域用户必须是域管理员组的成员。 在这些步骤的用户部分中代表域用户使用单独的管理员帐户将不起作用。

还存在其他未在下面介绍的先决条件,例如确保虚拟机已启用嵌套虚拟化(如果您计划使用 WSL2),以及拥有计算机 GPO 来创建和填充用户需要成为其成员的“docker-users”组。 Windows 10/11 版本应与正在使用的 WSL/Docker 版本相同。

分步指南 - Docker / WSLv2(Win 10 或 11)

  1. 在新的应用程序层(首选)或操作系统层修订版中,以管理员身份:

    一个。 dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

    b. dism.exe /online /enable-feature /功能名称:VirtualMachinePlatform /all /norestart

    c. 禁用 wsl 自动更新

      i.    reg add hklm\software\Microsoft\Windows\CurrentVersion\Lxss /t REG_DWORD /v AutoUpdate /d 0 /f
    

    d. 重新启动以安装功能,然后重新登录

    e. 从 Microsoft/WSL下载并安装最新的稳定 WSL 版本

      i.    Move the download to a place where users can access it later (do this BEFORE installing it)
       
      ii.    Install of WSL must be done from the same folder location that users will be using
       
          1.  Do not use the wsl --install command
       
          2.  Sample install command: 'msiexec -i wsl.2.3.26.0.x64.msi /L*V wsl-install.log'
       
          3.  Suggestion: create a "UserInstall.cmd" script containing a similar msiexec command to be used in step 2.a
       
      iii.    If an older WSL installation is present it should be uninstalled first (using 'msiexec /x' to fully remove it)
       
      iv.    It is not recommended to install a specific distro into the app layer.   Users can choose a distro later if they wish to.
       
      v.    Do not remove the WSL .msi installer from this folder.   Users will need to apply this exact .msi during their setup later.
    

    f. 使用“wsl –version”验证 wsl 是否正常工作

    g. (可选)将 .wslconfig 添加到默认用户配置文件

      i.    Existing users would need to copy this to their own profile
       
      ii.    The default network operation for wsl2 should be established in a file named .wslconfig and placed in \Users\Default.
       
          1.  .wslconfig contains two lines: '[wsl2]' and 'networkingMode=mirrored' (without quotes, case as shown)
       
          2.  Only new users-layer users will automatically have this file copied to their profile area
       
          3.  Place a copy of the .wslconfig file in the WSL installer location for existing users to copy
    

    h. 下载并安装 Docker

      i.    See [Install Docker Desktop on Windows](https://docs.docker.com/desktop/install/windows-install/)
       
      ii.    Docker will log out
       
      iii.    Log back in (Docker will start itself, but this can be ignored now)
       
      iv.    'Accept' terms and Close the Docker Desktop sign-in window
       
      v.    In the latest releases of Docker, an error popup may appear at this time (see exact text of this popup in Info section below).   Docker now seems to demand the presence of an installed distro.   This popup can be dismissed and ignored, and Docker will exit due to this.   That too can be ignored at this point in the installation steps. 我。  完成层(对于应用层,必须包含在图像中;不以弹性方式交付)
    
  2. 对于每个登录的用户:

    一个。 找到并运行 WSL 安装程序(从步骤 1.ei 保存)

      i.    This will be a fast and minimal install that only sets up reparse-points for the user
       
      ii.    This is a one-time install for each user, but can be used again if wsl problems arise
       
      iii.    Do not copy the wsl .msi to an alternate location before installing it (e.g., 'cd \WSL' and repeat the original/similar msiexec command)
    

    b. 使用 powershell 安装私有发行版:(以 ubuntu-1604 发行版为例)

      i.    Invoke-WebRequest -Uri [https://aka.ms/wsl-ubuntu-1604](https://aka.ms/wsl-ubuntu-1604) -OutFile ~/Ubuntu.zip -UseBasicParsing
       
      ii.    mkdir ~/distros
       
      iii.    Expand-Archive ~/Ubuntu.zip ~/distros/Ubuntu
       
      iv.    Run the installer as admin ~/distros/Ubuntu/ubuntu*.exe (exact name is version specific)
       
      v.    Provide a username and password you will use to log into wsl, and complete the install
       
      vi.    When this completes, update the distro in the distro-specific fashion ( sudo apt-get update; sudo apt-get upgrade )
       
      vii.    (Optional) create a desktop shortcut to the installed distro's main application
       
      viii.    Leave your distro window running for the remaining steps
    

    c. 从开始菜单启动 Docker Desktop

      i.    Allow Docker to initialize and start the docker engine
       
      ii.    Important: Docker needs to be made aware of your distro
       
          1.  In Docker, go to 'Setting->Resources→WSL Integration'
       
              a.    Enable the 'additional distro' that matches yours
       
              b.    Disable the 'default WSL distro' selection
       
      iii.    Also, you can control Docker auto-startup in 'Settings→General'
       
      iv.    Remember that your distro/WSL session needs to be started before the Docker engine can start successfully
    

升级

每次推出升级的 WSL/Docker App Layering 时,每个受影响的用户都需要使用之前的 WSL/Docker 层进行修复操作。

Docker