Instal·lar Docker a Windows 10

Per fer servir Docker a Windows 10 haurem d'instal·lar Docker Desktop, per la qual cosa hem seguit la documentació de Laravel. Entre altres coses, cal tenir instal·lat WSL (Windows Subsystem Linux) al nostre PC. Durant el procés, haurem de consultar els enllaços que ens indica, per revisar la documentació de Docker, Microsoft/Windows, etc.

Un cop tenim fet tot això, a l'ordinador tenim Docker Desktop i Docker Compose (no té entorn gràfic, en principi). Cada cop que arrenquem el PC, si no ho deshabilitem, Docker Desktop estarà corrent. Com que en el nostre cas ho tenim instal·lat, per començar a treballar-hi, anem a la icona de Windows, busquem el programa i fem clic. Al cap de dos minuts ja el tindrem funcionant:

Docker Desktop

Ho podem comprovar per què ara, si cerquem a les aplicacions del nostre PC, veiem que tenim instal·lat un Ubuntu Server 20:04:

En obrir aquest servidor, tenim un terminal d'Ubuntu, al qual si executem les comandes adients veurem que ens diu que tenim Docker Desktop i Docker Compose instal·lats:

entoni@DESKTOP-7S97ASB:~$ ls -la
Docker version 20.10.17, build 100c701
entoni@DESKTOP-7S97ASB:~$ docker-compose --version
docker-compose version 1.29.2, build 5becea4c

Si ara llistem els arxius i directoris:

entoni@DESKTOP-7S97ASB:~$ ls -la

Veurem que llista una línia interessant que munta la unitat de l'usuari del PC (propietari)

total 32
drwxr-xr-x 4 entoni entoni 4096 Nov  1 13:01 .
drwxr-xr-x 3 root   root   4096 Oct 31 18:35 ..
lrwxrwxrwx 1 entoni entoni   28 Oct 31 18:37 .aws -> /mnt/c/Users/propietari/.aws
lrwxrwxrwx 1 entoni entoni   30 Oct 31 18:37 .azure -> /mnt/c/Users/propietari/.azure
-rw------- 1 entoni entoni  113 Nov  1 13:50 .bash_history
-rw-r--r-- 1 entoni entoni  220 Oct 31 18:35 .bash_logout
-rw-r--r-- 1 entoni entoni 3771 Oct 31 18:35 .bashrc
drwxr-xr-x 5 entoni entoni 4096 Oct 31 18:37 .docker
drwxr-xr-x 2 entoni entoni 4096 Oct 31 18:36 .landscape
-rw-r--r-- 1 entoni entoni    0 Nov 19 18:19 .motd_shown
-rw-r--r-- 1 entoni entoni  807 Oct 31 18:35 .profile
  

Per tant, si ara fem anem a aquest directori, provem d'anar a la carpeta /code (on tenim els nostres projectes i que penja directament de /propietari) i llistem el directori:

entoni@DESKTOP-7S97ASB:~$ cd /mnt/c/Users/propietari/
entoni@DESKTOP-7S97ASB:~$ cd /code
entoni@DESKTOP-7S97ASB:~$ ls -la

Veiem que ens mostra efectivament les carpetes amb els nostres projectes:

drwxrwxrwx 1 entoni entoni 4096 Feb 15  2019 adminlte
drwxrwxrwx 1 entoni entoni 4096 Oct 12 12:28 ajuntament-de-taradell-140330tar
drwxrwxrwx 1 entoni entoni 4096 Nov  5  2018 boixonline
drwxrwxrwx 1 entoni entoni 4096 Oct 16  2018 boixweb
-rwxrwxrwx 1 entoni entoni 2069 Oct  9  2021 ca.homestead.homestead.crt
drwxrwxrwx 1 entoni entoni 4096 Oct  6  2021 camping
drwxrwxrwx 1 entoni entoni 4096 Mar  2  2022 carriletbus
drwxrwxrwx 1 entoni entoni 4096 Dec 26  2019 erctaradell
drwxrwxrwx 1 entoni entoni 4096 Oct 15  2018 escuelait
drwxrwxrwx 1 entoni entoni 4096 Nov  5  2021 infe
drwxrwxrwx 1 entoni entoni 4096 Jun  9 17:06 lasdunas
drwxrwxrwx 1 entoni entoni 4096 Oct 12 20:44 lidiarelats
drwxrwxrwx 1 entoni entoni 4096 Apr  9  2022 lorri
drwxrwxrwx 1 entoni entoni 4096 Feb 24  2021 patricio
drwxrwxrwx 1 entoni entoni 4096 May  1  2021 phpmyadmin
drwxrwxrwx 1 entoni entoni 4096 Jun  4  2021 phpmyadmin_old
drwxrwxrwx 1 entoni entoni 4096 Apr 22  2022 robotfarmacia
drwxrwxrwx 1 entoni entoni 4096 Jun 12 23:21 solucionsweb
-rwxrwxrwx 1 entoni entoni 1830 Jun 11 19:27 solucionsweb.test.crt
drwxrwxrwx 1 entoni entoni 4096 Feb  4  2022 tropicgallery
drwxrwxrwx 1 entoni entoni 4096 May 16  2021 udlarjuandemegon
drwxrwxrwx 1 entoni entoni 4096 Sep 25 17:49 verticalpine

Continuarà. . . o no!

# bash

Comentaris