Téléchargez "Docker Desktop" : https://hub.docker.com/editions/community/docker-ce-desktop-windows/ :
Docker Desktop Installer.exe" ;
Install required Windows components for WSL 2" et "Add shortcut to desktop" ;OK" ;
Close and log out" ;
I accept the terms" ;Accept".
Skip tutorial".Effectuez les réglages suivants :
Settings" ;General" ;
Send usage statistics" ;Show weekly tips" ;Apply & Restart" ;Windows PowerShell".Listez les distributions linux enregistrées dans WSL :
wsl -l -v ;La distribution par défaut est, ici, "Debian". Dans les paramètres de "Docker Desktop" :
Resources" => "WSL INTEGRATION" ;
Enable integration with my default WSL distro" (Option cochée par défaut) ;Software Updates" ;
Automatically check for updates" (Option cochée par défaut).Démarrez la distribution Linux activée pour Docker :
Windows PowerShell" ;
wsl -d Debian ;Exécutez le container "hello-world" :
docker run hello-world ;
L'image "hello-world" n'est pas trouvée. Le container est donc téléchargé depuis la librairie officielle. Vous devez obtenir l'image écran ci-dessus.
Portainer.io est un outil qui permet de construire et de gérer des conteneurs. Pour l'installer, procédez de la manière suivante :
Windows PowerShell" ;wsl -d Debian ;
docker volume create portainer_data ;docker run -d -p 8000:8000 -p 9000:9000 --name portainer --restart=always -v
/var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data cr.portainer.io/portainer/portainer-ce:2.9.3 ;
Réseau privés, ... ;Réseau publics, ... ;Autoriser l'accès".Installez les paquets suivants :
sudo apt install net-tools dnsutils wget ;Obtenez l'adresse IP de la machine virtuelle - Ici : Debian :
ifconfig ;http://<IP WSL Debian>:9000 ;
Allow collection of anonymous statistics." ;Create user" ;
Get Started" ;Vous devez obtenir l'écran suivant :
Pour mettre à jour Portainer.io :
docker stop portainer ;docker rm portainer ;docker run -d -p 8000:8000 -p 9000:9000 --name portainer --restart=always -v
/var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data cr.portainer.io/portainer/portainer-ce:latest ;La mise à jour est terminée. Connectez-vous sur "portainer.io" ; vous devez visualiser le numéro de version sur l'écran d'accueil "Home Environments".
Nous allons installer "MySQL" sur "WSL" via "Portainer.io".
local" ;App Templates" ;
MySQL container configuration" ;
Name], tapez : mysql ;Network], sélectionnez "bridge" ;Root password], tapez : un mot de passe ;Deploy the container" ;Vous devez obtenir l'écran suivant :
MySQL" ;Duplicate/Edit" ;
Network ports configuration" ;Host], tapez : 3306 ;Deploy the container" ;Téléchargez le fichier "mysql-apt-config_0.8.20-1_all.deb" (A faire sur WSL Debian) :
wget https://repo.mysql.com/mysql-apt-config_0.8.20-1_all.deb" ;sudo apt install lsb-release gnupg" ;sudo apt install mysql-client" ;sudo dpkg -i mysql-apt-config_0.8.20-1_all.deb" ;
OK" ;Testez la connexion à partir de la console WSL Debian :
mysql -h <Adresse IP WSL Debian> -P 3306 -u root -p.MySQL fonctionne ...