Superposition d'applications

Docker

Pour installer le service App Layering, déployez l’appliance sur une machine virtuelle sur votre hyperviseur.

Comment installer WSL et Docker

Ces instructions s’appliquent à tous les types d’images App Layering, mais sont principalement destinées à être utilisées avec des déploiements UserLayer complets de postes de travail VDI non persistants. Consultez les instructions associées dans Étapes d’installation manuelle pour les anciennes versions de WSL. Pour la superposition d’applications, ces instructions fourniront WSL et Docker comme base pour les utilisateurs de domaine dans un pool VDI déployé de machines virtuelles.

Les utilisateurs du domaine qui tentent d’utiliser WSL et/ou Docker doivent être membres du groupe d’administrateurs du domaine. L’utilisation d’un compte administrateur distinct au nom d’un utilisateur de domaine pendant la partie utilisateur de ces étapes ne fonctionnera pas.

D’autres prérequis existent qui ne sont pas couverts ci-dessous, comme s’assurer que la virtualisation imbriquée est activée sur les machines virtuelles (si vous prévoyez d’utiliser WSL2) et qu’un GPO d’ordinateur est présent pour créer et remplir un groupe « docker-users » dont les utilisateurs doivent être membres. Les versions de Windows 10/11 doivent être à jour avec la version de WSL/Docker utilisée.

Guide étape par étape – Docker / WSLv2 (Win 10 ou 11)

  1. Dans une nouvelle couche d’application (préférée) ou une révision de la couche du système d’exploitation, en tant qu’administrateur :

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

    b. dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

    c. Désactiver les mises à jour automatiques WSL

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

    d. Redémarrez pour installer les fonctionnalités, puis reconnectez-vous

    f. Téléchargez et installez la dernière version stable de WSL à partir de Microsoft/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. Utilisez « wsl –version » pour vérifier que wsl fonctionne

    g. (Facultatif) ajoutez un .wslconfig au profil utilisateur par défaut

      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. Téléchargez et installez 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. je.  Finaliser la couche (pour la couche d'application, doit être incluse dans l'image ; non livrée de manière élastique)
    
  2. Pour chaque utilisateur se connectant :

    un. Localisez et exécutez le programme d’installation WSL (enregistré à l’étape 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. Installer une distribution privée à l’aide de PowerShell : (exemple utilisant la distribution 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. Lancez Docker Desktop depuis le menu Démarrer

      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
    

Mise à niveau

Chaque fois qu’une couche d’application WSL/Docker mise à niveau est déployée, chaque utilisateur concerné aura besoin d’une opération de réparation à l’aide de la couche WSL/Docker précédente.

Docker