Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:docker3:drf04 [2021/12/29 10:33] adminelearning:workbooks:docker3:drf04 [2024/02/21 13:40] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Version : **2022.01**+Version : **2024.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
Ligne 13: Ligne 13:
     * LAB #1 - Docker Compose     * LAB #1 - Docker Compose
       * 1.1 - Installation       * 1.1 - Installation
-      * 1.2 - Utiliser docker-compose+      * 1.2 - Installer Wordpress avec Docker Compose
     * LAB #2 - Docker Machine     * LAB #2 - Docker Machine
       * 2.1 - Présentation       * 2.1 - Présentation
Ligne 49: Ligne 49:
  
 <code> <code>
-root@debian9:~# curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose+root@debian11:~# curl -L "https://github.com/docker/compose/releases/download/v2.0.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed                                  Dload  Upload   Total   Spent    Left  Speed
-100   617      617           912      0 --:--:-- --:--:-- --:--:--   912 +  0     0           0          0      0 --:--:-- --:--:-- --:--:--     0 
-100 5140k  100 5140k        0  2145k       0:00:02  0:00:02 --:--:-- 5232k +100 24.7M  100 24.7M        0  45.5M      --:--:-- --:--:-- --:--:-- 45.5M
- +
-root@debian9:~# chmod +x /usr/local/bin/docker-compose +
 </code> </code>
  
-Rendez **/usr/local/bin/docker-compose** exécutable :+Vérifiez la version installée :
  
 <code> <code>
-root@debian9:~# ls -l /usr/local/bin/docker-compose  +root@debian11:~# docker-compose --version 
--rw-r--r-- 1 root staff 5263681 Jan  2 16:29 /usr/local/bin/docker-compose +Docker Compose version v2.0.1
-root@debian9:~# chmod u+x /usr/local/bin/docker-compose +
 </code> </code>
  
-Avant de commencer, installez l'utilitaire **tree** :+Rendez **/usr/local/bin/docker-compose** exécutable :
  
 <code> <code>
-root@debian9:~# apt-get install tree +root@debian11:~# chmod +x /usr/local/bin/docker-compose 
-Reading package lists... Done +
-Building dependency tree        +
-Reading state information... Done +
-The following NEW packages will be installed: +
-  tree +
-0 upgraded, 1 newly installed, 0 to remove and 99 not upgraded. +
-Need to get 45.9 kB of archives. +
-After this operation, 102 kB of additional disk space will be used. +
-Get:1 http://ftp.fr.debian.org/debianjessie/main tree amd64 1.7.0-3 [45.9 kB] +
-Fetched 45.9 kB in 0s (429 kB/s) +
-Selecting previously unselected package tree. +
-(Reading database ... 100654 files and directories currently installed.) +
-Preparing to unpack .../tree_1.7.0-3_amd64.deb ... +
-Unpacking tree (1.7.0-3) ... +
-Processing triggers for man-db (2.7.0.2-5) ... +
-Setting up tree (1.7.0-3) ... +
-</code>+
  
-====1.2 - Utiliser docker-compose==== +root@debian11:~# ls -/usr/local/bin/docker-compose 
- +-rwxr-xr-x 1 root root 25907200 Dec 16 12:15 /usr/local/bin/docker-compose
-===Une Application Simple=== +
- +
-Dans ce LAB vous allez créer une application simple ayant deux environnements différents : +
- +
-  * development +
-  * production +
- +
-afin d'utiliser deux configurations différentes selon l'environnement désiré. +
- +
-Commencez par créer l'arborescence du projet : +
- +
-<code> +
-root@debian9:~# mkdir -p MyApp/common +
-root@debian9:~# mkdir -p MyApp/development/content +
-root@debian9:~# mkdir -p MyApp/production/content +
-root@debian9:~# touch MyApp/common/docker-compose.yml MyApp/development/docker-compose.yml MyApp/production/docker-compose.yml +
-root@debian9:~# touch MyApp/production/content/Dockerfile MyApp/production/content/index.html +
-root@debian9:~# touch MyApp/development/content/Dockerfile MyApp/development/content/index.html+
 </code> </code>
  
-Utilisez l'utilitaire tree pour visualiser la structure du projet :+Les options de la commande **docker-compose** sont :
  
 <code> <code>
-root@debian9:~# cd MyApp +root@debian11:~# docker-compose --help
-root@debian9:~/MyApp# tree +
-+
-├── common +
-│   └── docker-compose.yml +
-├── development +
-│   ├── content +
-│   │   ├── Dockerfile +
-│   │   └── index.html +
-│   └── docker-compose.yml +
-└── production +
-    ├── content +
-    │   ├── Dockerfile +
-    │   └── index.html +
-    └── docker-compose.yml+
  
-5 directories, 7 files +Usage:  docker compose [OPTIONS] COMMAND
-</code>+
  
-Ce projet comporte la structure suivante : +Docker Compose
- +
-  * **common** +
-    * La configuration commune aux deux environnements sera placée dans le fichier **MyApp/common/docker-compose.yml**. +
-  * **development** +
-    * La configuration spécifique à l'environnement **development** sera placée dans le fichier **MyApp/development/docker-compose.yml**. Le contenu du fichier **index.html** sera **This is the development environement**.  +
-  * **production** +
-    * La configuration spécifique à l'environnement **production** sera placée dans le fichier **MyApp/production/docker-compose.yml**. Le contenu du fichier **index.html** sera **This is the production environment**. +
- +
-Commencez par la création des deux Dockerfile pour **development** et **production**. Afin de garder l'exemple le plus simple que possible, ces deux fichiers sont identiques : +
- +
-<code> +
-root@debian9:~/MyApp# vi development/content/Dockerfile  +
- +
-root@debian9:~/MyApp# cat development/content/Dockerfile  +
-FROM tianon/true +
- +
-VOLUME ["/usr/share/nginx/html/"]  +
-ADD index.html /usr/share/nginx/html/ +
- +
-root@debian9:~/MyApp# cp development/content/Dockerfile production/content/Dockerfile  +
-</code> +
- +
-Créez maintenant le fichier **MyApp/common/docker-compose.yml** : +
- +
-<code> +
-root@debian9:~/MyApp# vi common/docker-compose.yml +
- +
-root@debian9:~/MyApp# cat common/docker-compose.yml +
-web:  +
-  image: nginx  +
-  ports:  +
-    - 8082:80 +
-</code> +
- +
-Les deux fichiers **MyApp/development/docker-compose.yml** et **MyApp/production/docker-compose.yml** sont identiques : +
- +
-<code> +
-root@debian9:~/MyApp# vi development/docker-compose.yml +
-  +
-root@debian9:~/MyApp# cat development/docker-compose.yml  +
-web:  +
-  extends:  +
-    file: ../common/docker-compose.yml  +
-    service: web  +
-  volumes_from:  +
-    - content +
- +
-content:  +
-  build: content +
- +
-root@debian9:~/MyApp# cp development/docker-compose.yml production/docker-compose.yml +
-</code> +
- +
-Éditez maintenant les deux fichiers index.html : +
- +
-<code> +
-root@debian9:~/MyApp# vi development/content/index.html +
- +
-root@debian9:~/MyApp# cat development/content/index.html +
-<html> +
-<body> +
-<center>This is the development environement</center> +
-</body> +
-</html> +
- +
-root@debian9:~/MyApp# vi production/content/index.html +
- +
-root@debian9:~/MyApp# cat production/content/index.html +
-<html> +
-<body> +
-<center>This is the production environement</center> +
-</body> +
-</html> +
-</code> +
- +
-Placez-vous dans le sous-répertoire **development** et exécutez la commande **docker-compose up -d** : +
- +
-<code> +
-root@debian9:~/MyApp/development# docker-compose up -d +
-Creating development_content_1... +
-Building content... +
-Step 1/3 : FROM tianon/true +
- ---> 1298b2036003 +
-Step 2/3 : VOLUME /usr/share/nginx/html/ +
- ---> Running in 8619de833add +
- ---> 694e4f111996 +
-Removing intermediate container 8619de833add +
-Step 3/3 : ADD index.html /usr/share/nginx/html/ +
- ---> f6fabac6703b +
-Removing intermediate container a9bec35dba66 +
-Successfully built f6fabac6703b +
-Successfully tagged development_content:latest +
-Creating development_web_1... +
-</code> +
- +
-La commande **docker-compose up** est une abréviation des commandes **docker-compose build && docker-compose run**. L'option **-d** a le même effet de son homologue de la commande **docker**. +
- +
-Les options de la commande **docker-compose** sont : +
- +
-<code> +
-root@debian9:~# docker-compose --help +
-Fast, isolated development environments using Docker+
- +
-Usage: +
-  docker-compose [options] [COMMAND] [ARGS...] +
-  docker-compose -h|--help+
  
 Options: Options:
-  --verbose                 Show more output +      --ansi string                Control when to print ANSI control 
-  --version                 Print version and exit +                                   characters ("never"|"always"|"auto"
-  -f, --file FILE           Specify an alternate compose file (default: docker-compose.yml+                                   (default "auto"
-  -p, --project-name NAME   Specify an alternate project name (default: directory name)+      --compatibility              Run compose in backward compatibility mode 
 +      --env-file string            Specify an alternate environment file. 
 +  -f, --file stringArray           Compose configuration files 
 +      --profile stringArray        Specify a profile to enable 
 +      --project-directory string   Specify an alternate working directory 
 +                                   (default: the path of the Compose file
 +  -p, --project-name string        Project name
  
 Commands: Commands:
-  build     Build or rebuild services +  build       Build or rebuild services 
-  help      Get help on a command +  convert     Converts the compose file to platform's canonical format 
-  kill      Kill containers +  cp          Copy files/folders between a service container and the local filesystem 
-  logs      View output from containers +  create      Creates containers for a service. 
-  port      Print the public port for a port binding +  down        Stop and remove containers, networks 
-  ps        List containers +  events      Receive real time events from containers. 
-  pull      Pulls service images +  exec        Execute a command in a running container. 
-  rm        Remove stopped containers +  images      List images used by the created containers 
-  run       Run a one-off command +  kill        Force stop service containers. 
-  scale     Set number of containers for a service +  logs        View output from containers 
-  start     Start services +  ls          List running compose projects 
-  stop      Stop services +  pause       pause services 
-  restart   Restart services +  port        Print the public port for a port binding. 
-  up        Create and start containers +  ps          List containers 
-</code> +  pull        Pull service images 
- +  push        Push service images 
-Vérifiez que l'image **development_content** a été créée : +  restart     Restart containers 
- +  rm          Removes stopped service containers 
-<code> +  run         Run a one-off command on a service. 
-root@debian9:~/MyApp/development# docker images +  start       Start services 
-REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE +  stop        Stop services 
-development_content        latest              f6fabac6703b        19 seconds ago      209B +  top         Display the running processes 
-... +  unpause     unpause services 
-</code> +  up          Create and start containers
- +
-Constatez la présence des deux conteneurs **nginx:latest** et **development_content** : +
- +
-<code> +
-root@debian9:~/MyApp/development# docker ps -a +
-CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                           PORTS                  NAMES +
-6955516dceff        nginx:latest          "nginx -g 'daemon ..."   28 seconds ago      Up 27 seconds                    0.0.0.0:8082->80/tcp   development_web_1 +
-9a1876d7a145        development_content   "/true"                  28 seconds ago      Exited (0) 27 seconds ago                               development_content_1 +
-... +
-</code> +
- +
-Utilisez maintenant lynx pour consultez **http://localhost:8082** : +
- +
-<code> +
-root@debian9:~/MyApp/development# lynx --dump http://localhost:8082 +
-                    This is the development environement +
- +
- +
-root@debian9:~/MyApp/development#  +
-</code> +
- +
-Arrêtez docker-compose : +
- +
-<code> +
-root@debian9:~/MyApp/development# docker-compose stop  +
-Stopping development_web_1... +
-root@debian9:~/MyApp/development# docker ps -a +
-CONTAINER ID        IMAGE                 COMMAND                  CREATED              STATUS                           PORTS               NAMES +
-6955516dceff        nginx:latest          "nginx -g 'daemon ..."   About a minute ago   Exited (0) 5 seconds ago                             development_web_1 +
-9a1876d7a145        development_content   "/true"                  About a minute ago   Exited (0) About a minute ago                        development_content_1 +
-... +
-</code> +
- +
-Placez-vous maintenant dans le sous-répertoire **production** et exécutez de nouveau la commande **docker-compose up -d** : +
- +
-<code> +
-root@debian9:~/MyApp/development# cd ../production/ +
-root@debian9:~/MyApp/production# docker-compose up -d +
-Creating production_content_1... +
-Building content... +
-Step 1/3 : FROM tianon/true +
- ---> 1298b2036003 +
-Step 2/3 : VOLUME /usr/share/nginx/html/ +
- ---> Using cache +
- ---> 694e4f111996 +
-Step 3/3 : ADD index.html /usr/share/nginx/html/ +
- ---> 61bcd73aff6e +
-Removing intermediate container 18af8bcb48ce +
-Successfully built 61bcd73aff6e +
-Successfully tagged production_content:latest +
-Creating production_web_1... +
-</code> +
- +
-Notez la création du conteneur **production_content** : +
- +
-<code> +
-root@debian9:~/MyApp/production# docker ps -a +
-CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                          PORTS                  NAMES +
-8a2c7346a5db        nginx:latest          "nginx -g 'daemon ..."   4 seconds ago       Up 3 seconds                    0.0.0.0:8082->80/tcp   production_web_1 +
-5fde5e7cbd47        production_content    "/true"                  4 seconds ago       Exited (0) 3 seconds ago                               production_content_1 +
-6955516dceff        nginx:latest          "nginx -g 'daemon ..."   2 minutes ago       Exited (0) About a minute ago                          development_web_1 +
-9a1876d7a145        development_content   "/true"                  2 minutes ago       Exited (0) 2 minutes ago                               development_content_1 +
-... +
-</code> +
- +
-En étant dans le contexte **production**, il est possible d'utiliser la commande **docker-compose ps** : +
- +
-<code> +
-root@debian9:~/MyApp/production# docker-compose ps +
-        Name                 Command          State           Ports          +
---------------------------------------------------------------------------- +
-production_content_1   /true                  Exit 0                         +
-production_web_1       nginx -g daemon off;   Up       0.0.0.0:8082->80/tcp  +
-</code> +
- +
-De même en utilisant la même commande dans le répertoire **development**, on peut constater l'état de l'environnement **development** : +
- +
-<code> +
-root@debian9:~/MyApp/production# cd ../development/ +
-root@debian9:~/MyApp/development# docker-compose ps +
-        Name                  Command          State    Ports  +
-------------------------------------------------------------- +
-development_content_1   /true                  Exit 0          +
-development_web_1       nginx -g daemon off;   Exit 0    +
-</code> +
- +
-Utilisez maintenant lynx pour consultez **http://localhost:8082** : +
- +
-<code> +
-root@debian9:~/MyApp/development# lynx --dump http://localhost:8082 +
-                     This is the production environement +
  
-root@debian9:~/MyApp/development#+Run 'docker compose COMMAND --help' for more information on a command.
 </code> </code>
  
-===Installer Wordpress avec Docker Compose===+====1.2 - Installer Wordpress avec Docker Compose====
  
 Créez maintenant le répertoire **wordpress1** dans /root : Créez maintenant le répertoire **wordpress1** dans /root :
  
 <code> <code>
-root@debian9:~/MyApp/development# cd ~ 
 root@debian9:~# mkdir wordpress1 root@debian9:~# mkdir wordpress1
 </code> </code>
Ligne 415: Ligne 169:
  
 <code> <code>
-root@debian9:~/wordpress1# docker-compose up -d+root@debian11:~/wordpress1# docker-compose up -d 
 +[+] Running 12/12 
 + ⠿ db Pulled                                                                                                                                                                                            16.0s 
 +   ⠿ 20e4dcae4c69 Pull complete                                                                                                                                                                          5.7s 
 +   ⠿ 1c56c3d4ce74 Pull complete                                                                                                                                                                          5.8s 
 +   ⠿ e9f03a1c24ce Pull complete                                                                                                                                                                          5.9s 
 +   ⠿ 68c3898c2015 Pull complete                                                                                                                                                                          6.2s 
 +   ⠿ 6b95a940e7b6 Pull complete                                                                                                                                                                          6.3s 
 +   ⠿ 90986bb8de6e Pull complete                                                                                                                                                                          6.3s 
 +   ⠿ ae71319cb779 Pull complete                                                                                                                                                                          7.4s 
 +   ⠿ ffc89e9dfd88 Pull complete                                                                                                                                                                          7.4s 
 +   ⠿ 43d05e938198 Pull complete                                                                                                                                                                         15.2s 
 +   ⠿ 064b2d298fba Pull complete                                                                                                                                                                         15.3s 
 +   ⠿ df9a4d85569b Pull complete                                                                                                                                                                         15.3s 
 +[+] Running 4/4 
 + ⠿ Network wordpress1_default        Created                                                                                                                                                             0.1s 
 + ⠿ Volume "wordpress1_db_data"       Created                                                                                                                                                             0.0s 
 + ⠿ Container wordpress1-db-1         Started                                                                                                                                                            10.7s 
 + ⠿ Container wordpress1-wordpress-1  Started                                                                                                                                                             1.5s
 </code> </code>
  
Ligne 421: Ligne 193:
  
 <code> <code>
-root@debian9:~/wordpress1# lynx --dump http://10.0.2.60:8000+root@debian11:~/wordpress1# lynx --dump http://10.0.2.46:8000
    WordPress    WordPress
-   Select a default language [English (United States)________]+   Select a default language [English (United States)__________]
  
    Continue    Continue
        
-root@debian9:~# docker ps -a +root@debian11:~/wordpress1# docker ps 
-CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                      PORTS                  NAMES +CONTAINER ID   IMAGE                                   COMMAND                  CREATED              STATUS          PORTS                                   NAMES 
-29afa2a7fdb5        wordpress:latest      "docker-entrypoint.s…"   21 minutes ago      Up 20 minutes               0.0.0.0:8000->80/tcp   wordpress1_wordpress_1 +9475874569e1   wordpress:latest                        "docker-entrypoint.s…"   51 seconds ago       Up 49 seconds   0.0.0.0:8000->80/tcp, :::8000->80/tcp   wordpress1-wordpress-1 
-...+5983cdf711ec   mysql:5.7                               "docker-entrypoint.s…"   About a minute ago   Up 50 seconds   3306/tcp, 33060/tcp                     wordpress1-db-1 
 +cf27f30654d2   dockersamples/examplevotingapp_worker   "dotnet Worker.dll"      20 hours ago         Up 20 hours                                             worker 
 +33a264a36bdc   dockersamples/examplevotingapp_result   "/usr/bin/tini -- no…"   20 hours ago         Up 20 hours     0.0.0.0:5001->80/tcp, :::5001->80/tcp   result 
 +81e6fcb9f692   dockersamples/examplevotingapp_vote     "gunicorn app:app -b…"   20 hours ago         Up 20 hours     0.0.0.0:5000->80/tcp, :::5000->80/tcp   vote 
 +5083545dcbf8   postgres:9.4                            "docker-entrypoint.s…"   20 hours ago         Up 20 hours     5432/tcp                                db 
 +227554e3e4c1   redis                                   "docker-entrypoint.s…"   20 hours ago         Up 20 hours     6379/tcp                                redis 
 +63fec083f4d6   wordpress                               "docker-entrypoint.s…"   21 hours ago         Up 21 hours     10.0.2.46:80->80/tcp                    wordpress 
 +db3732939266   mysql:latest                            "docker-entrypoint.s…"   21 hours ago         Up 21 hours     3306/tcp, 33060/tcp                     wordpressdb 
 +57e92a8b25d7   centos                                  "/bin/bash"              21 hours ago         Up 21 hours                                             centos3 
 +fc417b22a20d   centos                                  "/bin/bash"              21 hours ago         Up 21 hours                                             centos2 
 +cb2875ab1059   centos                                  "/bin/bash"              21 hours ago         Up 21 hours                                             centos1 
 +2126924504d8   centos                                  "/bin/bash"              21 hours ago         Up 21 hours                                             resotest
  
-root@debian9:~/wordpress1# docker inspect wordpress1_wordpress_1 | grep IPAddress+root@debian11:~/wordpress1# docker inspect wordpress1-wordpress-1 | grep IPAddress
             "SecondaryIPAddresses": null,             "SecondaryIPAddresses": null,
-            "IPAddress": "172.17.0.7", +            "IPAddress": "", 
-                    "IPAddress": "172.17.0.7",+                    "IPAddress": "172.18.0.3",
                                          
-root@debian9:~/wordpress1# lynx --dump http://172.17.0.7+root@debian11:~/wordpress1# lynx --dump http://172.18.0.3
    WordPress    WordPress
-   Select a default language [English (United States)________]+   Select a default language [English (United States)__________]
  
    Continue    Continue
 </code> </code>
 +
 +<WRAP center round important 50%>
 +**Important** - La commande **docker-compose up** est une abréviation des commandes **docker-compose build && docker-compose run**. L'option **-d** a le même effet de son homologue de la commande **docker**.
 +</WRAP>
  
 =====LAB #2 - Docker Machine===== =====LAB #2 - Docker Machine=====
Ligne 452: Ligne 239:
 Le jeu de commandes de docker-machine permet de démarrer, surveiller, arrêter et re-démarrer un hôte géré, de mettre à jour le client/daemon docker et de configurer un client docker afin qu'il "parle" à votre machine hôte. Le jeu de commandes de docker-machine permet de démarrer, surveiller, arrêter et re-démarrer un hôte géré, de mettre à jour le client/daemon docker et de configurer un client docker afin qu'il "parle" à votre machine hôte.
  
-Pour installer docker-machine sur votre VM **debian9**, utilisez la commande suivante :+Pour installer docker-machine sur votre VM **debian11**, utilisez la commande suivante :
  
 <code> <code>
-root@debian9:~# curl -L https://github.com/docker/machine/releases/download/v0.12.2/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && chmod +x /tmp/docker-machine && cp /tmp/docker-machine /usr/local/bin/docker-machine+root@debian11:~/wordpress1# cd ~ 
 + 
 +root@debian11:~# curl -L https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && chmod +x /tmp/docker-machine && cp /tmp/docker-machine /usr/local/bin/docker-machine 
 +  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current 
 +                                 Dload  Upload   Total   Spent    Left  Speed 
 +  0        0        0          0      0 --:--:-- --:--:-- --:--:--     0 
 +100 32.6M  100 32.6M    0      48.5M      0 --:--:-- --:--:-- --:--:-- 48.5M
 </code> </code>
  
Ligne 480: Ligne 273:
  
 <code> <code>
-root@debian9:~/wordpresscd ~ +root@debian11:~# apt install virtualbox-6.1 -y 
-root@debian9:~apt install virtualbox-6.0+Reading package lists... Done 
 +Building dependency tree... Done 
 +Reading state information... Done 
 +The following packages were automatically installed and are no longer required: 
 +  libopengl0 linux-headers-5.10.0-15-amd64 linux-headers-5.10.0-15-common 
 +Use 'apt autoremove' to remove them. 
 +Recommended packages: 
 +  linux-image 
 +The following packages will be upgraded: 
 +  virtualbox-6.1 
 +1 upgraded, 0 newly installed, 0 to remove and 16 not upgraded. 
 +Need to get 95.8 MB of archives. 
 +After this operation, 53.2 kB disk space will be freed. 
 +Get:1 http://download.virtualbox.org/virtualbox/debian bullseye/contrib amd64 virtualbox-6.1 amd64 6.1.48-159471~Debian~bullseye [95.8 MB] 
 +Fetched 95.8 MB in 3s (31.4 MB/s)           
 +apt-listchanges: Reading changelogs... 
 +Preconfiguring packages ... 
 +(Reading database ... 166797 files and directories currently installed.) 
 +Preparing to unpack .../virtualbox-6.1_6.1.48-159471~Debian~bullseye_amd64.deb ... 
 +Unpacking virtualbox-6.1 (6.1.48-159471~Debian~bullseye) over (6.1.46-158378~Debian~bullseye) ... 
 +Setting up virtualbox-6.1 (6.1.48-159471~Debian~bullseye) ... 
 +addgroup: The group `vboxusers' already exists as a system group. Exiting. 
 +Processing triggers for hicolor-icon-theme (0.17-2) ... 
 +Processing triggers for shared-mime-info (2.0-1) ... 
 +Processing triggers for mailcap (3.69) ... 
 +Processing triggers for desktop-file-utils (0.26-1) ... 
 +</code> 
 + 
 +Créez le fichier **/etc/vbox/networks.conf** : 
 + 
 +<code> 
 +root@debian11:~# vi /etc/vbox/networks.conf 
 +root@debian11:~# cat /etc/vbox/networks.conf 
 +* 10.0.0.0/8 192.168.0.0/16
 </code> </code>
  
Ligne 487: Ligne 313:
  
 <code> <code>
-root@debian9:~# docker-machine create --driver virtualbox manager1 +root@debian11:~# docker-machine create --driver virtualbox manager1
-Creating CA: /root/.docker/machine/certs/ca.pem +
-Creating client certificate: /root/.docker/machine/certs/cert.pem+
 Running pre-create checks... Running pre-create checks...
 (manager1) Image cache directory does not exist, creating it at /root/.docker/machine/cache... (manager1) Image cache directory does not exist, creating it at /root/.docker/machine/cache...
 (manager1) No default Boot2Docker ISO found locally, downloading the latest release... (manager1) No default Boot2Docker ISO found locally, downloading the latest release...
-(manager1) Latest release for github.com/boot2docker/boot2docker is v17.06.2-ce +(manager1) Latest release for github.com/boot2docker/boot2docker is v19.03.12 
-(manager1) Downloading /root/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v17.06.2-ce/boot2docker.iso...+(manager1) Downloading /root/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v19.03.12/boot2docker.iso...
 (manager1) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100% (manager1) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
 Creating machine... Creating machine...
Ligne 520: Ligne 344:
  
 <code> <code>
-root@debian9:~# docker-machine --help+root@debian11:~# docker-machine --help
 Usage: docker-machine [OPTIONS] COMMAND [arg...] Usage: docker-machine [OPTIONS] COMMAND [arg...]
  
 Create and manage machines running Docker. Create and manage machines running Docker.
  
-Version: 0.12.2, build 9371605+Version: 0.16.2, build bd45ab13
  
 Author: Author:
Ligne 531: Ligne 355:
  
 Options: Options:
-  --debug, -D Enable debug mode +  --debug, -D                                   Enable debug mode 
-  --storage-path, -s "/root/.docker/machine" Configures storage path [$MACHINE_STORAGE_PATH] +  --storage-path, -s "/root/.docker/machine"    Configures storage path [$MACHINE_STORAGE_PATH] 
-  --tls-ca-cert  CA to verify remotes against [$MACHINE_TLS_CA_CERT] +  --tls-ca-cert                                 CA to verify remotes against [$MACHINE_TLS_CA_CERT] 
-  --tls-ca-key  Private key to generate certificates [$MACHINE_TLS_CA_KEY] +  --tls-ca-key                                  Private key to generate certificates [$MACHINE_TLS_CA_KEY] 
-  --tls-client-cert  Client cert to use for TLS [$MACHINE_TLS_CLIENT_CERT] +  --tls-client-cert                             Client cert to use for TLS [$MACHINE_TLS_CLIENT_CERT] 
-  --tls-client-key  Private key used in client TLS auth [$MACHINE_TLS_CLIENT_KEY] +  --tls-client-key                              Private key used in client TLS auth [$MACHINE_TLS_CLIENT_KEY] 
-  --github-api-token  Token to use for requests to the Github API [$MACHINE_GITHUB_API_TOKEN] +  --github-api-token                            Token to use for requests to the Github API [$MACHINE_GITHUB_API_TOKEN] 
-  --native-ssh Use the native (Go-based) SSH implementation. [$MACHINE_NATIVE_SSH] +  --native-ssh                                  Use the native (Go-based) SSH implementation. [$MACHINE_NATIVE_SSH] 
-  --bugsnag-api-token  BugSnag API token for crash reporting [$MACHINE_BUGSNAG_API_TOKEN] +  --bugsnag-api-token                           BugSnag API token for crash reporting [$MACHINE_BUGSNAG_API_TOKEN] 
-  --help, -h show help +  --help, -h                                    show help 
-  --version, -v print the version+  --version, -v                                 print the version
      
 Commands: Commands:
-  active Print which machine is active +  active                Print which machine is active 
-  config Print the connection config for machine +  config                Print the connection config for machine 
-  create Create a machine +  create                Create a machine 
-  env Display the commands to set up the environment for the Docker client +  env                   Display the commands to set up the environment for the Docker client 
-  inspect Inspect information about a machine +  inspect               Inspect information about a machine 
-  ip Get the IP address of a machine +  ip                    Get the IP address of a machine 
-  kill Kill a machine +  kill                  Kill a machine 
-  ls List machines +  ls                    List machines 
-  provision Re-provision existing machines +  provision             Re-provision existing machines 
-  regenerate-certs Regenerate TLS Certificates for a machine +  regenerate-certs      Regenerate TLS Certificates for a machine 
-  restart Restart a machine +  restart               Restart a machine 
-  rm Remove a machine +  rm                    Remove a machine 
-  ssh Log into or run a command on a machine with SSH. +  ssh                   Log into or run a command on a machine with SSH. 
-  scp Copy files between machines +  scp                   Copy files between machines 
-  start Start a machine +  mount                 Mount or unmount a directory from a machine with SSHFS. 
-  status Get the status of a machine +  start                 Start a machine 
-  stop Stop a machine +  status                Get the status of a machine 
-  upgrade Upgrade a machine to the latest version of Docker +  stop                  Stop a machine 
-  url Get the URL of a machine +  upgrade               Upgrade a machine to the latest version of Docker 
-  version Show the Docker Machine version or a machine docker version +  url                   Get the URL of a machine 
-  help Shows a list of commands or help for one command+  version               Show the Docker Machine version or a machine docker version 
 +  help                  Shows a list of commands or help for one command
      
 Run 'docker-machine COMMAND --help' for more information on a command. Run 'docker-machine COMMAND --help' for more information on a command.
 +</code> 
 +
 +Les options de la sous-commande **create** de la commande **docker-machine** sont :
 +
 +<code>
 +root@debian11:~# docker-machine create --help
 +Usage: docker-machine create [OPTIONS] [arg...]
 +
 +Create a machine
 +
 +Description:
 +   Run 'docker-machine create --driver name --help' to include the create flags for that driver in the help text.
 +
 +Options:
 +   
 +   --driver, -d "virtualbox"                                                                            Driver to create machine with. [$MACHINE_DRIVER]
 +   --engine-env [--engine-env option --engine-env option]                                               Specify environment variables to set in the engine
 +   --engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option]     Specify insecure registries to allow with the created engine
 +   --engine-install-url "https://get.docker.com"                                                        Custom URL to use for engine installation [$MACHINE_DOCKER_INSTALL_URL]
 +   --engine-label [--engine-label option --engine-label option]                                         Specify labels for the created engine
 +   --engine-opt [--engine-opt option --engine-opt option]                                               Specify arbitrary flags to include with the created engine in the form flag=value
 +   --engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option]           Specify registry mirrors to use [$ENGINE_REGISTRY_MIRROR]
 +   --engine-storage-driver                                                                              Specify a storage driver to use with the engine
 +   --swarm                                                                                              Configure Machine to join a Swarm cluster
 +   --swarm-addr                                                                                         addr to advertise for Swarm (default: detect and use the machine IP)
 +   --swarm-discovery                                                                                    Discovery service to use with Swarm
 +   --swarm-experimental                                                                                 Enable Swarm experimental features
 +   --swarm-host "tcp://0.0.0.0:3376"                                                                    ip/socket to listen on for Swarm master
 +   --swarm-image "swarm:latest"                                                                         Specify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE]
 +   --swarm-join-opt [--swarm-join-opt option --swarm-join-opt option]                                   Define arbitrary flags for Swarm join
 +   --swarm-master                                                                                       Configure Machine to be a Swarm master
 +   --swarm-opt [--swarm-opt option --swarm-opt option]                                                  Define arbitrary flags for Swarm master
 +   --swarm-strategy "spread"                                                                            Define a default scheduling strategy for Swarm
 +   --tls-san [--tls-san option --tls-san option]                                                        Support extra SANs for TLS certs
 +   --virtualbox-boot2docker-url                                                                         The URL of the boot2docker image. Defaults to the latest available version [$VIRTUALBOX_BOOT2DOCKER_URL]
 +   --virtualbox-cpu-count "1"                                                                           number of CPUs for the machine (-1 to use the number of CPUs available) [$VIRTUALBOX_CPU_COUNT]
 +   --virtualbox-disk-size "20000"                                                                       Size of disk for host in MB [$VIRTUALBOX_DISK_SIZE]
 +   --virtualbox-host-dns-resolver                                                                       Use the host DNS resolver [$VIRTUALBOX_HOST_DNS_RESOLVER]
 +   --virtualbox-hostonly-cidr "192.168.99.1/24"                                                         Specify the Host Only CIDR [$VIRTUALBOX_HOSTONLY_CIDR]
 +   --virtualbox-hostonly-nicpromisc "deny"                                                              Specify the Host Only Network Adapter Promiscuous Mode [$VIRTUALBOX_HOSTONLY_NIC_PROMISC]
 +   --virtualbox-hostonly-nictype "82540EM"                                                              Specify the Host Only Network Adapter Type [$VIRTUALBOX_HOSTONLY_NIC_TYPE]
 +   --virtualbox-hostonly-no-dhcp                                                                        Disable the Host Only DHCP Server [$VIRTUALBOX_HOSTONLY_NO_DHCP]
 +   --virtualbox-import-boot2docker-vm                                                                   The name of a Boot2Docker VM to import [$VIRTUALBOX_BOOT2DOCKER_IMPORT_VM]
 +   --virtualbox-memory "1024"                                                                           Size of memory for host in MB [$VIRTUALBOX_MEMORY_SIZE]
 +   --virtualbox-nat-nictype "82540EM"                                                                   Specify the Network Adapter Type [$VIRTUALBOX_NAT_NICTYPE]
 +   --virtualbox-no-dns-proxy                                                                            Disable proxying all DNS requests to the host [$VIRTUALBOX_NO_DNS_PROXY]
 +   --virtualbox-no-share                                                                                Disable the mount of your home directory [$VIRTUALBOX_NO_SHARE]
 +   --virtualbox-no-vtx-check                                                                            Disable checking for the availability of hardware virtualization before the vm is started [$VIRTUALBOX_NO_VTX_CHECK]
 +   --virtualbox-share-folder                                                                            Mount the specified directory instead of the default home location. Format: dir:name [$VIRTUALBOX_SHARE_FOLDER]
 +   --virtualbox-ui-type "headless"                                                                      Specify the UI Type: (gui|sdl|headless|separate) [$VIRTUALBOX_UI_TYPE]
 </code>  </code> 
  
Ligne 572: Ligne 447:
  
 <code> <code>
-root@debian9:~# docker-machine create --driver virtualbox worker1+root@debian11:~# docker-machine create --driver virtualbox worker1
 Running pre-create checks... Running pre-create checks...
 Creating machine... Creating machine...
Ligne 595: Ligne 470:
  
 <code> <code>
-root@debian9:~# docker-machine create --driver virtualbox worker2+root@debian11:~# docker-machine create --driver virtualbox worker2
 ... ...
-root@debian9:~# docker-machine create --driver virtualbox worker3+root@debian11:~# docker-machine create --driver virtualbox worker3
 ... ...
-root@debian9:~# docker-machine create --driver virtualbox worker4+root@debian11:~# docker-machine create --driver virtualbox worker4
 ... ...
-root@debian9:~# docker-machine create --driver virtualbox worker5+root@debian11:~# docker-machine create --driver virtualbox worker5
 ... ...
 </code> </code>
- 
-Les options de la sous-commande **create** de la commande **docker-machine** sont : 
- 
-<code> 
-root@debian9:~# docker-machine create --help  
-Usage: docker-machine create [OPTIONS] [arg...] 
- 
-Create a machine 
- 
-Description: 
-   Run 'docker-machine create --driver name' to include the create flags for that driver in the help text. 
- 
-Options: 
-    
-   --driver, -d "virtualbox" Driver to create machine with. [$MACHINE_DRIVER] 
-   --engine-env [--engine-env option --engine-env option] Specify environment variables to set in the engine 
-   --engine-insecure-registry [--engine-insecure-registry option --engine-insecure-registry option] Specify insecure registries to allow with the created engine 
-   --engine-install-url "https://get.docker.com" Custom URL to use for engine installation [$MACHINE_DOCKER_INSTALL_URL] 
-   --engine-label [--engine-label option --engine-label option] Specify labels for the created engine 
-   --engine-opt [--engine-opt option --engine-opt option] Specify arbitrary flags to include with the created engine in the form flag=value 
-   --engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option] Specify registry mirrors to use [$ENGINE_REGISTRY_MIRROR] 
-   --engine-storage-driver Specify a storage driver to use with the engine 
-   --swarm Configure Machine to join a Swarm cluster 
-   --swarm-addr addr to advertise for Swarm (default: detect and use the machine IP) 
-   --swarm-discovery Discovery service to use with Swarm 
-   --swarm-experimental Enable Swarm experimental features 
-   --swarm-host "tcp://0.0.0.0:3376" ip/socket to listen on for Swarm master 
-   --swarm-image "swarm:latest" Specify Docker image to use for Swarm [$MACHINE_SWARM_IMAGE] 
-   --swarm-join-opt [--swarm-join-opt option --swarm-join-opt option] Define arbitrary flags for Swarm join 
-   --swarm-master Configure Machine to be a Swarm master 
-   --swarm-opt [--swarm-opt option --swarm-opt option] Define arbitrary flags for Swarm master 
-   --swarm-strategy "spread" Define a default scheduling strategy for Swarm 
-   --tls-san [--tls-san option --tls-san option] Support extra SANs for TLS certs 
-   --virtualbox-boot2docker-url The URL of the boot2docker image. Defaults to the latest available version [$VIRTUALBOX_BOOT2DOCKER_URL] 
-   --virtualbox-cpu-count "1" number of CPUs for the machine (-1 to use the number of CPUs available) [$VIRTUALBOX_CPU_COUNT] 
-   --virtualbox-disk-size "20000" Size of disk for host in MB [$VIRTUALBOX_DISK_SIZE] 
-   --virtualbox-host-dns-resolver Use the host DNS resolver [$VIRTUALBOX_HOST_DNS_RESOLVER] 
-   --virtualbox-hostonly-cidr "192.168.99.1/24" Specify the Host Only CIDR [$VIRTUALBOX_HOSTONLY_CIDR] 
-   --virtualbox-hostonly-nicpromisc "deny" Specify the Host Only Network Adapter Promiscuous Mode [$VIRTUALBOX_HOSTONLY_NIC_PROMISC] 
-   --virtualbox-hostonly-nictype "82540EM" Specify the Host Only Network Adapter Type [$VIRTUALBOX_HOSTONLY_NIC_TYPE] 
-   --virtualbox-hostonly-no-dhcp Disable the Host Only DHCP Server [$VIRTUALBOX_HOSTONLY_NO_DHCP] 
-   --virtualbox-import-boot2docker-vm The name of a Boot2Docker VM to import [$VIRTUALBOX_BOOT2DOCKER_IMPORT_VM] 
-   --virtualbox-memory "1024" Size of memory for host in MB [$VIRTUALBOX_MEMORY_SIZE] 
-   --virtualbox-nat-nictype "82540EM" Specify the Network Adapter Type [$VIRTUALBOX_NAT_NICTYPE] 
-   --virtualbox-no-dns-proxy Disable proxying all DNS requests to the host [$VIRTUALBOX_NO_DNS_PROXY] 
-   --virtualbox-no-share Disable the mount of your home directory [$VIRTUALBOX_NO_SHARE] 
-   --virtualbox-no-vtx-check Disable checking for the availability of hardware virtualization before the vm is started [$VIRTUALBOX_NO_VTX_CHECK] 
-   --virtualbox-share-folder Mount the specified directory instead of the default home location. Format: dir:name [$VIRTUALBOX_SHARE_FOLDER] 
-   --virtualbox-ui-type "headless" Specify the UI Type: (gui|sdl|headless|separate) [$VIRTUALBOX_UI_TYPE] 
-</code>  
  
 ====2.3 - Lister les VM Docker==== ====2.3 - Lister les VM Docker====
Ligne 660: Ligne 485:
  
 <code> <code>
-root@debian9:~# docker-machine ls +root@debian11:~# docker-machine ls 
-NAME       ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER        ERRORS +NAME       ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER      ERRORS 
-manager1          virtualbox   Running   tcp://192.168.99.100:2376           v17.06.2-ce    +manager1          virtualbox   Running   tcp://192.168.99.100:2376           v19.03.12    
-worker1    -        virtualbox   Running   tcp://192.168.99.101:2376           v17.06.2-ce    +worker1    -        virtualbox   Running   tcp://192.168.99.101:2376           v19.03.12    
-worker2    -        virtualbox   Running   tcp://192.168.99.102:2376           v17.06.2-ce    +worker2    -        virtualbox   Running   tcp://192.168.99.102:2376           v19.03.12    
-worker3    -        virtualbox   Running   tcp://192.168.99.103:2376           v17.06.2-ce    +worker3    -        virtualbox   Running   tcp://192.168.99.103:2376           v19.03.12    
-worker4    -        virtualbox   Running   tcp://192.168.99.104:2376           v17.06.2-ce    +worker4    -        virtualbox   Running   tcp://192.168.99.104:2376           v19.03.12    
-worker5    -        virtualbox   Running   tcp://192.168.99.105:2376           v17.06.2-ce   +worker5    -        virtualbox   Running   tcp://192.168.99.105:2376           v19.03.12   
 </code> </code>
  
Ligne 675: Ligne 500:
  
 <code> <code>
-root@debian9:~# docker-machine ip manager1+root@debian11:~# docker-machine ip manager1
 192.168.99.100 192.168.99.100
-root@debian9:~# docker-machine ip worker1+root@debian11:~# docker-machine ip worker1
 192.168.99.101 192.168.99.101
-root@debian9:~# docker-machine ip worker2+root@debian11:~# docker-machine ip worker2
 192.168.99.102 192.168.99.102
-root@debian9:~# docker-machine ip worker3+root@debian11:~# docker-machine ip worker3
 192.168.99.103 192.168.99.103
-root@debian9:~# docker-machine ip worker4+root@debian11:~# docker-machine ip worker4
 192.168.99.104 192.168.99.104
-root@debian9:~# docker-machine ip worker5+root@debian11:~# docker-machine ip worker5
 192.168.99.105 192.168.99.105
 </code> </code>
Ligne 694: Ligne 519:
  
 <code> <code>
-root@debian9:~# docker-machine ssh manager1 +root@debian11:~# docker-machine ssh manager1 
-                        ##         . +   ( '>') 
-                  ## ## ##        == +  /) TC (  Core is distributed with ABSOLUTELY NO WARRANTY. 
-               ## ## ## ## ##    === + (/-_--_-\)           www.tinycorelinux.net 
-           /"""""""""""""""""\___/ === +
-      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~ +
-           \______ o           __/ +
-                \         __/ +
-              \____\_______/ +
-                   ____                _ +
-| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __ +
-'_ \ / _ \ / _ \| __| __/ _` |/ _ \ / __| |/ / _ \ '__| +
-| |_) | (_) | (_) | |_ __/ (_| | (_(__|   <  __/ | +
-|_.__\___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_| +
-Boot2Docker version 17.06.2-ce, build HEAD : ff16afa - Wed Sep  6 00:17:25 UTC 2017 +
-Docker version 17.06.2-ce, build cec0b72+
 docker@manager1:~$ exit docker@manager1:~$ exit
 +logout
 +root@debian11:~#
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 50%>
 **Important** - Notez que la distribution de la VM est **[[http://boot2docker.io/|Boot2Docker]]**. Cette distribution est basée sur **[[http://tinycorelinux.net/|Tiny Core Linux]]**, s'exécute entièrement dans la mémoire vive, pèse 27 Mo et démarre en approximativement 5 secondes. **Important** - Notez que la distribution de la VM est **[[http://boot2docker.io/|Boot2Docker]]**. Cette distribution est basée sur **[[http://tinycorelinux.net/|Tiny Core Linux]]**, s'exécute entièrement dans la mémoire vive, pèse 27 Mo et démarre en approximativement 5 secondes.
 </WRAP> </WRAP>
Ligne 720: Ligne 536:
  
 <code> <code>
-root@debian9:~# apt install mlocate +root@debian11:~# apt install mlocate -y 
-...+Reading package lists... Done 
 +Building dependency tree... Done 
 +Reading state information... Done 
 +The following packages were automatically installed and are no longer required: 
 +  libopengl0 linux-headers-5.10.0-15-amd64 linux-headers-5.10.0-15-common 
 +Use 'apt autoremove' to remove them. 
 +Suggested packages: 
 +  nocache 
 +The following NEW packages will be installed: 
 +  mlocate 
 +0 upgraded, 1 newly installed, 0 to remove and 16 not upgraded. 
 +Need to get 98.3 kB of archives. 
 +After this operation, 517 kB of additional disk space will be used. 
 +Get:1 http://deb.debian.org/debian bullseye/main amd64 mlocate amd64 0.26-5 [98.3 kB] 
 +Fetched 98.3 kB in 0s (1,985 kB/s)  
 +Selecting previously unselected package mlocate. 
 +(Reading database ... 166797 files and directories currently installed.) 
 +Preparing to unpack .../mlocate_0.26-5_amd64.deb ... 
 +Unpacking mlocate (0.26-5) ... 
 +Setting up mlocate (0.26-5) ... 
 +update-alternatives: using /usr/bin/mlocate to provide /usr/bin/locate (locate) in auto mode 
 +Adding group `mlocate' (GID 123) ... 
 +Done. 
 +Created symlink /etc/systemd/system/timers.target.wants/mlocate.timer → /lib/systemd/system/mlocate.timer. 
 +mlocate.service is a disabled or a static unit, not starting it. 
 +Processing triggers for man-db (2.9.4-2) ...
 </code> </code>
  
Ligne 727: Ligne 568:
  
 <code> <code>
-root@debian9:~# updatedb +root@debian11:~# updatedb 
-root@debian9:~# locate manager1+ 
 +root@debian11:~# locate manager1
 /root/.docker/machine/machines/manager1 /root/.docker/machine/machines/manager1
 /root/.docker/machine/machines/manager1/boot2docker.iso /root/.docker/machine/machines/manager1/boot2docker.iso
Ligne 758: Ligne 600:
  
 <code> <code>
-root@debian9:~# docker-machine ssh manager1+root@debian11:~# docker-machine ssh manager1 
 +   ( '>'
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY. 
 + (/-_--_-\)           www.tinycorelinux.net 
 docker@manager1:~$ docker swarm init --advertise-addr 192.168.99.100 docker@manager1:~$ docker swarm init --advertise-addr 192.168.99.100
-Swarm initialized: current node (yuwpmvtfmdxn8i7nllkyzkxkp) is now a manager.+Swarm initialized: current node (y0war0lijmwhnexrfhfflulsd) is now a manager.
  
 To add a worker to this swarm, run the following command: To add a worker to this swarm, run the following command:
  
-    docker swarm join --token SWMTKN-1-5bd9w9tapfqmd41f2psqdkoqwfo48fqsznnalk2slc28vlp6uh-004kp8y71m09nd7p8ft7ldku0 192.168.99.100:2377+    docker swarm join --token SWMTKN-1-25tbmsyx452cuhpiedymuc8n9llo9jbjcbza93npdo35q1aaff-9teuxcpe09xw7v7xz1tnwpw4g 192.168.99.100:2377
  
 To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions. To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
Ligne 776: Ligne 622:
  
 <code> <code>
-docker@manager1:~$ docker node ls +docker@manager1:~$ docker node ls                                                                                                                                                                             
-ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS +ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION 
-yuwpmvtfmdxn8i7nllkyzkxkp *   manager1            Ready               Active              Leader+y0war0lijmwhnexrfhfflulsd *   manager1            Ready               Active              Leader              19.03.12
 </code> </code>
  
Ligne 786: Ligne 632:
  
 <code> <code>
-docker@manager1:~$ docker swarm join-token manager+docker@manager1:~$ docker swarm join-token manager                                                                                                                                                           
 To add a manager to this swarm, run the following command: To add a manager to this swarm, run the following command:
  
-    docker swarm join --token SWMTKN-1-5bd9w9tapfqmd41f2psqdkoqwfo48fqsznnalk2slc28vlp6uh-8rvbxvqewsrv6yyts7z2lq9pt 192.168.99.100:2377+    docker swarm join --token SWMTKN-1-25tbmsyx452cuhpiedymuc8n9llo9jbjcbza93npdo35q1aaff-1teue04djnc4vu2eufzty59ys 192.168.99.100:2377
 </code> </code>
  
Ligne 797: Ligne 643:
  
 <code> <code>
-docker@worker1:~$ docker swarm join --token SWMTKN-1-5bd9w9tapfqmd41f2psqdkoqwfo48fqsznnalk2slc28vlp6uh-004kp8y71m09nd7p8ft7ldku0 192.168.99.100:2377+docker@manager1:~$ exit                                                                                                                                                                                       
 +logout 
 + 
 +root@debian11:~# docker-machine ssh worker1 
 +   ( '>'
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY. 
 + (/-_--_-\)           www.tinycorelinux.net 
 + 
 +docker@worker1:~$ docker swarm join --token SWMTKN-1-25tbmsyx452cuhpiedymuc8n9llo9jbjcbza93npdo35q1aaff-9teuxcpe09xw7v7xz1tnwpw4g 192.168.99.100:2377
 This node joined a swarm as a worker. This node joined a swarm as a worker.
-</code> 
  
-<code+docker@worker1:~$ exit                                                                                                                                                                                        
-docker@worker2:~$ docker swarm join --token SWMTKN-1-5bd9w9tapfqmd41f2psqdkoqwfo48fqsznnalk2slc28vlp6uh-004kp8y71m09nd7p8ft7ldku0 192.168.99.100:2377+logout 
 + 
 +root@debian11:~# docker-machine ssh worker2 
 +   ( '>') 
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY. 
 + (/-_--_-\)           www.tinycorelinux.net 
 + 
 +docker@worker2:~$ docker swarm join --token SWMTKN-1-25tbmsyx452cuhpiedymuc8n9llo9jbjcbza93npdo35q1aaff-9teuxcpe09xw7v7xz1tnwpw4g 192.168.99.100:2377
 This node joined a swarm as a worker. This node joined a swarm as a worker.
-</code> 
  
-<code+docker@worker2:~$ exit                                                                                                                                                                                        
-docker@worker3:~$ docker swarm join --token SWMTKN-1-5bd9w9tapfqmd41f2psqdkoqwfo48fqsznnalk2slc28vlp6uh-004kp8y71m09nd7p8ft7ldku0 192.168.99.100:2377+logout 
 + 
 +root@debian11:~# docker-machine ssh worker3 
 +   ( '>') 
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY. 
 + (/-_--_-\)           www.tinycorelinux.net 
 + 
 +docker@worker3:~$ docker swarm join --token SWMTKN-1-25tbmsyx452cuhpiedymuc8n9llo9jbjcbza93npdo35q1aaff-9teuxcpe09xw7v7xz1tnwpw4g 192.168.99.100:2377
 This node joined a swarm as a worker. This node joined a swarm as a worker.
-</code> 
  
-<code+docker@worker3:~$ exit                                                                                                                                                                                        
-docker@worker4:~$ docker swarm join --token SWMTKN-1-5bd9w9tapfqmd41f2psqdkoqwfo48fqsznnalk2slc28vlp6uh-004kp8y71m09nd7p8ft7ldku0 192.168.99.100:2377+logout 
 + 
 +root@debian11:~# docker-machine ssh worker4 
 +   ( '>') 
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY. 
 + (/-_--_-\)           www.tinycorelinux.net 
 + 
 +docker@worker4:~$ docker swarm join --token SWMTKN-1-25tbmsyx452cuhpiedymuc8n9llo9jbjcbza93npdo35q1aaff-9teuxcpe09xw7v7xz1tnwpw4g 192.168.99.100:2377
 This node joined a swarm as a worker. This node joined a swarm as a worker.
-</code> 
  
-<code+docker@worker4:~$ exit                                                                                                                                                                                        
-docker@worker5:~$ docker swarm join --token SWMTKN-1-5bd9w9tapfqmd41f2psqdkoqwfo48fqsznnalk2slc28vlp6uh-004kp8y71m09nd7p8ft7ldku0 192.168.99.100:2377+logout 
 + 
 +root@debian11:~# docker-machine ssh worker5 
 +   ( '>') 
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY. 
 + (/-_--_-\)           www.tinycorelinux.net 
 + 
 +docker@worker5:~$ docker swarm join --token SWMTKN-1-25tbmsyx452cuhpiedymuc8n9llo9jbjcbza93npdo35q1aaff-9teuxcpe09xw7v7xz1tnwpw4g 192.168.99.100:2377
 This node joined a swarm as a worker. This node joined a swarm as a worker.
 +
 +docker@worker5:~$ exit                                                                                                                                                                                       
 +logout
 +
 +root@debian11:~# 
 </code> </code>
  
Ligne 826: Ligne 709:
  
 <code> <code>
-docker@manager1:~$ docker node ls +root@debian11:~# docker-machine ssh manager1 
-ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS +   ( '>'
-1f5qtolgtonqmhjk5ppwc8x1b     worker1             Ready               Active               +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY. 
-kmyjdwp9ojhzje4hlw7ffhuxv     worker2             Ready               Active               + (/-_--_-\)           www.tinycorelinux.net 
-oyszb44k8yw5btz3c1wq2ot2e     worker4             Ready               Active               + 
-p6jpyopzzy0zg4znegi63hzjq     worker5             Ready               Active               +docker@manager1:~$ docker node ls                                    
-yitkfnk99ecisrny9g3r9kfhk     worker3             Ready               Active               +ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION 
-yuwpmvtfmdxn8i7nllkyzkxkp *   manager1            Ready               Active              Leader+y0war0lijmwhnexrfhfflulsd *   manager1            Ready               Active              Leader              19.03.12 
 +v5ai62lmhfsdcauccqmjyu6qk     worker1             Ready               Active                                  19.03.12 
 +j4mr3d2ji30t7hu0trob5dpgz     worker2             Ready               Active                                  19.03.12 
 +pouo7nuvirq0qkuvvrp04a47h     worker3             Ready               Active                                  19.03.12 
 +mo0dd5ech6ifdgd8pa6cjz896     worker4             Ready               Active                                  19.03.12 
 +5am2vd39pybytu1nd3oooabtq     worker5             Ready               Active                                  19.03.12
 </code> </code>
  
Ligne 839: Ligne 727:
  
 <code> <code>
 +docker@manager1:~$ exit                                                                                                                                                                                      
 +logout
 +
 +root@debian11:~# docker-machine ssh worker5
 +   ( '>')
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY.
 + (/-_--_-\)           www.tinycorelinux.net
 +
 docker@worker5:~$ docker node ls docker@worker5:~$ docker node ls
 Error response from daemon: This node is not a swarm manager. Worker nodes can't be used to view or modify cluster state. Please run this command on a manager node or promote the current node to a manager. Error response from daemon: This node is not a swarm manager. Worker nodes can't be used to view or modify cluster state. Please run this command on a manager node or promote the current node to a manager.
 +
 +docker@worker5:~$ exit                                                                                                                                                                                       
 +logout
 +exit status 1
 +
 +root@debian11:~#
 </code> </code>
  
Ligne 848: Ligne 750:
  
 <code> <code>
 +root@debian11:~# docker-machine ssh manager1
 +   ( '>')
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY.
 + (/-_--_-\)           www.tinycorelinux.net
 +
 docker@manager1:~$ docker info docker@manager1:~$ docker info
-... +Client: 
-Swarm: active + Debug Mode: false 
- NodeID: yuwpmvtfmdxn8i7nllkyzkxkp + 
- Is Manager: true +Server: 
- ClusterID: sqll9xmii9qkrd35d1limn1od + Containers:
- Managers:+  Running: 0 
- Nodes:+  Paused: 0 
- Orchestration+  Stopped: 0 
-  Task History Retention Limit: 5 + Images:
- Raft: + Server Version: 19.03.12 
-  Snapshot Interval: 10000 + Storage Driver: overlay2 
-  Number of Old Snapshots to Retain: 0 +  Backing Filesystem: extfs 
-  Heartbeat Tick: 1 +  Supports d_type: true 
-  Election Tick: 3 +  Native Overlay Diff: true 
- Dispatcher: + Logging Driver: json-file 
-  Heartbeat Period: 5 seconds + Cgroup Driver: cgroupfs 
- CA Configuration: + Plugins: 
-  Expiry Duration: 3 months +  Volume: local 
-  Force Rotate: 0 +  Network: bridge host ipvlan macvlan null overlay 
- Root Rotation In Progress: false +  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog 
- Node Address: 192.168.99.100 + Swarm: active 
- Manager Addresses: +  NodeID: y0war0lijmwhnexrfhfflulsd 
-  192.168.99.100:2377 +  Is Manager: true 
-...+  ClusterID: w3mq6i01k4siboyqv3w3nbyu7 
 +  Managers: 1 
 +  Nodes: 6 
 +  Default Address Pool10.0.0.0/8   
 +  SubnetSize: 24 
 +  Data Path Port: 4789 
 +  Orchestration: 
 +   Task History Retention Limit: 5 
 +  Raft: 
 +   Snapshot Interval: 10000 
 +   Number of Old Snapshots to Retain: 0 
 +   Heartbeat Tick: 1 
 +   Election Tick: 10 
 +  Dispatcher: 
 +   Heartbeat Period: 5 seconds 
 +  CA Configuration: 
 +   Expiry Duration: 3 months 
 +   Force Rotate: 0 
 +  Autolock Managers: false 
 +  Root Rotation In Progress: false 
 +  Node Address: 192.168.99.100 
 +  Manager Addresses: 
 +   192.168.99.100:2377 
 + Runtimes: runc 
 + Default Runtime: runc 
 + Init Binary: docker-init 
 + containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429 
 + runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd 
 + init version: fec3683 
 + Security Options: 
 +  seccomp 
 +   Profile: default 
 + Kernel Version: 4.19.130-boot2docker 
 + Operating System: Boot2Docker 19.03.12 (TCL 10.1) 
 + OSType: linux 
 + Architecture: x86_64 
 + CPUs: 1 
 + Total Memory: 985.4MiB 
 + Name: manager1 
 + ID: UIL3:SNFZ:J2XE:4QVD:7XYM:MPB7:2LHC:NMY7:B4CU:QMUK:3A66:H3G6 
 + Docker Root Dir: /mnt/sda1/var/lib/docker 
 + Debug Mode: false 
 + Registry: https://index.docker.io/v1/ 
 + Labels: 
 +  provider=virtualbox 
 + Experimental: false 
 + Insecure Registries: 
 +  127.0.0.0/
 + Live Restore Enabled: false 
 + Product License: Community Engine
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 50%>
 **Important** - Quand le moteur Docker est en mode swarm, les noeuds de gestion implémentent le **[[https://docs.docker.com/engine/swarm/raft/|Raft Consensus Algorithm]]** pour gérer l'état du cluster. **Important** - Quand le moteur Docker est en mode swarm, les noeuds de gestion implémentent le **[[https://docs.docker.com/engine/swarm/raft/|Raft Consensus Algorithm]]** pour gérer l'état du cluster.
 </WRAP> </WRAP>
Ligne 888: Ligne 844:
  
 <code> <code>
-docker@manager1:~$ docker service create --replicas 5 -p 80:80 --name web nginx +docker@manager1:~$ docker service create --replicas 5 -p 80:80 --name web nginx                                                                                                                               
-4xtuwgbvr17lvfzoumh1y4mq4 +oree977o1unlk5ndos0y44i2h 
-Since --detach=false was not specified, tasks will be created in the background. +overall progress: 5 out of 5 tasks  
-In a future release, --detach=false will become the default.+1/5: running   [==================================================>]  
 +2/5: running   [==================================================>]  
 +3/5: running   [==================================================>]  
 +4/5: running   [==================================================>]  
 +5/5: running   [==================================================>]  
 +verify: Service converged 
 </code> </code>
  
Ligne 897: Ligne 858:
  
 <code> <code>
-docker@manager1:~$ docker service ls+docker@manager1:~$ docker service ls                                                                                                                                                                         
 ID                  NAME                MODE                REPLICAS            IMAGE               PORTS ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
-4xtuwgbvr17l        web                 replicated          5/5                 nginx:latest        *:80->80/tcp+oree977o1unl        web                 replicated          5/5                 nginx:latest        *:80->80/tcp
 </code> </code>
  
Ligne 905: Ligne 866:
  
 <code> <code>
-docker@manager1:~$ docker service ps web +docker@manager1:~$ docker service ps web                                                                                                                                                                      
-ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE                ERROR               PORTS +ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS 
-jkm2hapcthht        web.1               nginx:latest        worker3             Running             Running about a minute ago                        +son0vgc73drb        web.1               nginx:latest        worker4             Running             Running 48 seconds ago                        
-q55eqdhr1qf1        web.2               nginx:latest        worker4             Running             Running about a minute ago                        +ojqyweuo65jw        web.2               nginx:latest        worker5             Running             Running 49 seconds ago                        
-imqdkw4ei6gs        web.3               nginx:latest        manager1            Running             Running about a minute ago                        +mb40onnaxd0u        web.3               nginx:latest        manager1            Running             Running 49 seconds ago                        
-k4vjd0g7ijww        web.4               nginx:latest        worker1             Running             Running about a minute ago                        +4vwsho5x7i36        web.4               nginx:latest        worker2             Running             Running 49 seconds ago                        
-b7xbmy1npgf9        web.5               nginx:latest        worker2             Running             Running about a minute ago+sk9hr6j2u47c        web.5               nginx:latest        worker3             Running             Running 50 seconds ago 
 </code> </code>
  
-<WRAP center round important> +<WRAP center round important 50%
-**Important** - Notez qu'il n'y a pas de conteneur sur worker5.+**Important** - Notez qu'il n'y a pas de conteneur sur worker1.
 </WRAP> </WRAP>
  
Ligne 921: Ligne 882:
  
 <code> <code>
-docker@manager1:~$ docker ps +docker@manager1:~$ docker ps                                                                                                                                                                                  
-CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES +CONTAINER ID        IMAGE               COMMAND                  CREATED              STATUS              PORTS               NAMES 
-4107cb687eda        nginx:latest        "nginx -g 'daemon ..."   2 minutes ago       Up 2 minutes        80/tcp              web.3.imqdkw4ei6gskwacnb4pime5f+244fecd46312        nginx:latest        "/docker-entrypoint.  About a minute ago   Up About a minute   80/tcp              web.3.mb40onnaxd0u8t0nhbzx9rdih 
 +</code> 
 + 
 +Par contre la même commande exécutée sur **worker1** donne le résultat suivant : 
 + 
 +<code> 
 +docker@manager1:~$ exit                                                                                                                                                                                       
 +logout 
 + 
 +root@debian11:~# docker-machine ssh worker1 
 +   ( '>'
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY. 
 + (/-_--_-\)           www.tinycorelinux.net 
 + 
 +docker@worker1:~$ docker ps 
 +CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES 
 +docker@worker1:~$ exit                                                                                                                                                                                        
 +logout 
 + 
 +root@debian11:~#
 </code> </code>
  
Ligne 929: Ligne 909:
  
 <code> <code>
-docker@manager1:/$ curl 192.168.99.100+root@debian11:~# docker-machine ssh manager1 
 +   ( '>'
 +  /) TC (\   Core is distributed with ABSOLUTELY NO WARRANTY. 
 + (/-_--_-\)           www.tinycorelinux.net 
 + 
 +docker@manager1:~$ curl 192.168.99.100
 <!DOCTYPE html> <!DOCTYPE html>
 <html> <html>
Ligne 935: Ligne 920:
 <title>Welcome to nginx!</title> <title>Welcome to nginx!</title>
 <style> <style>
-    body +html color-scheme: light dark; } 
-        width: 35em; +body { width: 35em; margin: 0 auto; 
-        margin: 0 auto; +font-family: Tahoma, Verdana, Arial, sans-serif; }
-        font-family: Tahoma, Verdana, Arial, sans-serif; +
-    }+
 </style> </style>
 </head> </head>
Ligne 955: Ligne 938:
 </body> </body>
 </html> </html>
-docker@manager1:/$ curl 192.168.99.101+ 
 +docker@manager1:~$ curl 192.168.99.101                                                                                                                                                                       
 <!DOCTYPE html> <!DOCTYPE html>
 <html> <html>
Ligne 961: Ligne 945:
 <title>Welcome to nginx!</title> <title>Welcome to nginx!</title>
 <style> <style>
-    body +html color-scheme: light dark; } 
-        width: 35em; +body { width: 35em; margin: 0 auto; 
-        margin: 0 auto; +font-family: Tahoma, Verdana, Arial, sans-serif; }
-        font-family: Tahoma, Verdana, Arial, sans-serif; +
-    }+
 </style> </style>
 </head> </head>
Ligne 981: Ligne 963:
 </body> </body>
 </html> </html>
-docker@manager1:/$ curl 192.168.99.102+ 
 +docker@manager1:~$ curl 192.168.99.102                                                                                                                                                                       
 <!DOCTYPE html> <!DOCTYPE html>
 <html> <html>
Ligne 987: Ligne 970:
 <title>Welcome to nginx!</title> <title>Welcome to nginx!</title>
 <style> <style>
-    body +html color-scheme: light dark; } 
-        width: 35em; +body { width: 35em; margin: 0 auto; 
-        margin: 0 auto; +font-family: Tahoma, Verdana, Arial, sans-serif; }
-        font-family: Tahoma, Verdana, Arial, sans-serif; +
-    }+
 </style> </style>
 </head> </head>
Ligne 1007: Ligne 988:
 </body> </body>
 </html> </html>
-docker@manager1:/$ curl 192.168.99.103+ 
 +docker@manager1:~$ curl 192.168.99.103                                                                                                                                                                       
 <!DOCTYPE html> <!DOCTYPE html>
 <html> <html>
Ligne 1013: Ligne 995:
 <title>Welcome to nginx!</title> <title>Welcome to nginx!</title>
 <style> <style>
-    body +html color-scheme: light dark; } 
-        width: 35em; +body { width: 35em; margin: 0 auto; 
-        margin: 0 auto; +font-family: Tahoma, Verdana, Arial, sans-serif; }
-        font-family: Tahoma, Verdana, Arial, sans-serif; +
-    }+
 </style> </style>
 </head> </head>
Ligne 1033: Ligne 1013:
 </body> </body>
 </html> </html>
-docker@manager1:/$ curl 192.168.99.104+ 
 +docker@manager1:~$ curl 192.168.99.104                                                                                                                                                                       
 <!DOCTYPE html> <!DOCTYPE html>
 <html> <html>
Ligne 1039: Ligne 1020:
 <title>Welcome to nginx!</title> <title>Welcome to nginx!</title>
 <style> <style>
-    body +html color-scheme: light dark; } 
-        width: 35em; +body { width: 35em; margin: 0 auto; 
-        margin: 0 auto; +font-family: Tahoma, Verdana, Arial, sans-serif; }
-        font-family: Tahoma, Verdana, Arial, sans-serif; +
-    }+
 </style> </style>
 </head> </head>
Ligne 1059: Ligne 1038:
 </body> </body>
 </html> </html>
-docker@manager1:/$ curl 192.168.99.105+ 
 +docker@manager1:~$ curl 192.168.99.105                                                                                                                                                                       
 <!DOCTYPE html> <!DOCTYPE html>
 <html> <html>
Ligne 1065: Ligne 1045:
 <title>Welcome to nginx!</title> <title>Welcome to nginx!</title>
 <style> <style>
-    body +html color-scheme: light dark; } 
-        width: 35em; +body { width: 35em; margin: 0 auto; 
-        margin: 0 auto; +font-family: Tahoma, Verdana, Arial, sans-serif; }
-        font-family: Tahoma, Verdana, Arial, sans-serif; +
-    }+
 </style> </style>
 </head> </head>
Ligne 1087: Ligne 1065:
 </code> </code>
  
-<WRAP center round important> +<WRAP center round important 50%
-**Important** - Notez que le service est même disponible en consultant l'adresse IP de worker5.+**Important** - Notez que le service est même disponible en consultant l'adresse IP de worker1.
 </WRAP> </WRAP>
  
Ligne 1096: Ligne 1074:
  
 <code> <code>
-docker@manager1:/$ docker service scale web=8+docker@manager1:~$ docker service scale web=8                                                                                                                                                                
 web scaled to 8 web scaled to 8
 +overall progress: 8 out of 8 tasks 
 +1/8: running   [==================================================>
 +2/8: running   [==================================================>
 +3/8: running   [==================================================>
 +4/8: running   [==================================================>
 +5/8: running   [==================================================>
 +6/8: running   [==================================================>
 +7/8: running   [==================================================>
 +8/8: running   [==================================================>
 +verify: Service converged 
 </code> </code>
  
Ligne 1103: Ligne 1091:
  
 <code> <code>
-docker@manager1:/$ docker service ls+docker@manager1:~$ docker service ls                                                                                                                                                                         
 ID                  NAME                MODE                REPLICAS            IMAGE               PORTS ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
-4xtuwgbvr17l        web                 replicated          8/8                 nginx:latest        *:80->80/tcp+oree977o1unl        web                 replicated          8/8                 nginx:latest        *:80->80/tcp
 </code> </code>
  
Ligne 1111: Ligne 1099:
  
 <code> <code>
-docker@manager1:/$ docker service ps web +docker@manager1:~$ docker service ps web                                                                                                                                                                      
-ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS +ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE                ERROR               PORTS 
-jkm2hapcthht        web.1               nginx:latest        worker3             Running             Running 20 minutes ago                        +son0vgc73drb        web.1               nginx:latest        worker4             Running             Running minutes ago                             
-q55eqdhr1qf1        web.2               nginx:latest        worker4             Running             Running 20 minutes ago                        +ojqyweuo65jw        web.2               nginx:latest        worker5             Running             Running minutes ago                             
-imqdkw4ei6gs        web.3               nginx:latest        manager1            Running             Running 20 minutes ago                        +mb40onnaxd0u        web.3               nginx:latest        manager1            Running             Running minutes ago                             
-k4vjd0g7ijww        web.4               nginx:latest        worker1             Running             Running 20 minutes ago                        +4vwsho5x7i36        web.4               nginx:latest        worker2             Running             Running minutes ago                             
-b7xbmy1npgf9        web.5               nginx:latest        worker2             Running             Running 20 minutes ago                        +sk9hr6j2u47c        web.5               nginx:latest        worker3             Running             Running minutes ago                             
-kg3bivcg0wln        web.6               nginx:latest        worker5             Running             Running 47 seconds ago                        +pui4dnkepu27        web.6               nginx:latest        worker1             Running             Running about a minute ago                        
-ik3u0jfgey64        web.7               nginx:latest        worker5             Running             Running 47 seconds ago                        +yj0kexdcuo5u        web.7               nginx:latest        worker5             Running             Running about a minute ago                        
-6bw5ptw7xao8        web.8               nginx:latest        worker1             Running             Running 57 seconds ago +93jtbxqj2dyz        web.8               nginx:latest        worker1             Running             Running about a minute ago 
 </code> </code>
  
Ligne 1128: Ligne 1116:
  
 <code> <code>
-docker@manager1:/$ docker node inspect self+docker@manager1:~$ docker node inspect self                                                                                                                                                                  
 [ [
     {     {
-        "ID": "yuwpmvtfmdxn8i7nllkyzkxkp",+        "ID": "y0war0lijmwhnexrfhfflulsd",
         "Version": {         "Version": {
             "Index": 9             "Index": 9
         },         },
-        "CreatedAt": "2017-09-08T11:43:55.289178512Z", +        "CreatedAt": "2023-12-16T13:38:18.600836601Z", 
-        "UpdatedAt": "2017-09-08T11:43:55.89870884Z",+        "UpdatedAt": "2023-12-16T13:38:19.126257379Z",
         "Spec": {         "Spec": {
             "Labels": {},             "Labels": {},
Ligne 1150: Ligne 1138:
             "Resources": {             "Resources": {
                 "NanoCPUs": 1000000000,                 "NanoCPUs": 1000000000,
-                "MemoryBytes": 1044123648+                "MemoryBytes": 1033252864
             },             },
             "Engine": {             "Engine": {
-                "EngineVersion": "17.06.2-ce",+                "EngineVersion": "19.03.12",
                 "Labels": {                 "Labels": {
                     "provider": "virtualbox"                     "provider": "virtualbox"
Ligne 1181: Ligne 1169:
                         "Type": "Log",                         "Type": "Log",
                         "Name": "json-file"                         "Name": "json-file"
 +                    },
 +                    {
 +                        "Type": "Log",
 +                        "Name": "local"
                     },                     },
                     {                     {
Ligne 1201: Ligne 1193:
                         "Type": "Network",                         "Type": "Network",
                         "Name": "host"                         "Name": "host"
 +                    },
 +                    {
 +                        "Type": "Network",
 +                        "Name": "ipvlan"
                     },                     },
                     {                     {
Ligne 1221: Ligne 1217:
             },             },
             "TLSInfo": {             "TLSInfo": {
-                "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUNuU4I89kxId2QXulofRKxJa9XRcwCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwOTA4MTEzOTAwWhcNMzcwOTAzMTEz\nOTAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABEqgLUbyjyNuP35aAzW+aqVB8AkghvpF5hq1KnMveHbl4Ilr+EyDjlYZkbnt\nGb/xmsy/tOP8uz598ZX/JlR4fZyjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBSzoKGrN0ELfEIMsjxuYj5LAckD2jAKBggqhkjO\nPQQDAgNIADBFAiB34DOvDtIYjJ+GzbPMGu9Dd/cJGvy7CJg1tNUG3SoOrAIhAJZ4\nTJBucTomFSDsj5Y/R6TfhcpXpsksk7JwYgEglu44\n-----END CERTIFICATE-----\n",+                "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBazCCARCgAwIBAgIUbi2tpJHqoqK+BA/p9c+Y9AmtQSAwCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMjMxMjE2MTMzMzAwWhcNNDMxMjExMTMz\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABKuD7Svum+bER9CszNtFt7ASMr5gj6Vea0oM7SCrlyYMCn8ryaHXQ9J+iEIh\nfWrpKmjNtei3/j+leOVF0flpg2OjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRqlCTTUy9JODtzaVecgmjID/M5kzAKBggqhkjO\nPQQDAgNJADBGAiEA06sGunqGwd23lyjcUoczMWGQGln9nv0pmm/riJQvB80CIQC9\nvXNZUbC6U5lSQ7eGhfmmHi1JAfb88wGau0AlreBczw==\n-----END CERTIFICATE-----\n",
                 "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",                 "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
-                "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAESqAtRvKPI24/floDNb5qpUHwCSCG+kXmGrUqcy94duXgiWv4TIOOVhmRue0Zv/GazL+04/y7Pn3xlf8mVHh9nA=="+                "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEq4PtK+6b5sRH0KzM20W3sBIyvmCPpV5rSgztIKuXJgwKfyvJoddD0n6IQiF9aukqaM216Lf+P6V45UXR+WmDYw=="
             }             }
         },         },
Ligne 1237: Ligne 1233:
     }     }
 ] ]
- 
 </code> </code>
  
Ligne 1243: Ligne 1238:
  
 <code> <code>
-docker@manager1:/$ docker node inspect worker1+docker@manager1:~$ docker node inspect worker1                                                                                                                                                               
 [ [
     {     {
-        "ID": "1f5qtolgtonqmhjk5ppwc8x1b",+        "ID": "v5ai62lmhfsdcauccqmjyu6qk",
         "Version": {         "Version": {
             "Index": 15             "Index": 15
         },         },
-        "CreatedAt": "2017-09-08T11:48:42.011596185Z", +        "CreatedAt": "2023-12-16T13:40:08.301827885Z", 
-        "UpdatedAt": "2017-09-08T11:48:42.093455479Z",+        "UpdatedAt": "2023-12-16T13:40:08.453463845Z",
         "Spec": {         "Spec": {
             "Labels": {},             "Labels": {},
Ligne 1265: Ligne 1260:
             "Resources": {             "Resources": {
                 "NanoCPUs": 1000000000,                 "NanoCPUs": 1000000000,
-                "MemoryBytes": 1044123648+                "MemoryBytes": 1033252864
             },             },
             "Engine": {             "Engine": {
-                "EngineVersion": "17.06.2-ce",+                "EngineVersion": "19.03.12",
                 "Labels": {                 "Labels": {
                     "provider": "virtualbox"                     "provider": "virtualbox"
Ligne 1296: Ligne 1291:
                         "Type": "Log",                         "Type": "Log",
                         "Name": "json-file"                         "Name": "json-file"
 +                    },
 +                    {
 +                        "Type": "Log",
 +                        "Name": "local"
                     },                     },
                     {                     {
Ligne 1316: Ligne 1315:
                         "Type": "Network",                         "Type": "Network",
                         "Name": "host"                         "Name": "host"
 +                    },
 +                    {
 +                        "Type": "Network",
 +                        "Name": "ipvlan"
                     },                     },
                     {                     {
Ligne 1336: Ligne 1339:
             },             },
             "TLSInfo": {             "TLSInfo": {
-                "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUNuU4I89kxId2QXulofRKxJa9XRcwCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwOTA4MTEzOTAwWhcNMzcwOTAzMTEz\nOTAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABEqgLUbyjyNuP35aAzW+aqVB8AkghvpF5hq1KnMveHbl4Ilr+EyDjlYZkbnt\nGb/xmsy/tOP8uz598ZX/JlR4fZyjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBSzoKGrN0ELfEIMsjxuYj5LAckD2jAKBggqhkjO\nPQQDAgNIADBFAiB34DOvDtIYjJ+GzbPMGu9Dd/cJGvy7CJg1tNUG3SoOrAIhAJZ4\nTJBucTomFSDsj5Y/R6TfhcpXpsksk7JwYgEglu44\n-----END CERTIFICATE-----\n",+                "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBazCCARCgAwIBAgIUbi2tpJHqoqK+BA/p9c+Y9AmtQSAwCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMjMxMjE2MTMzMzAwWhcNNDMxMjExMTMz\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABKuD7Svum+bER9CszNtFt7ASMr5gj6Vea0oM7SCrlyYMCn8ryaHXQ9J+iEIh\nfWrpKmjNtei3/j+leOVF0flpg2OjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRqlCTTUy9JODtzaVecgmjID/M5kzAKBggqhkjO\nPQQDAgNJADBGAiEA06sGunqGwd23lyjcUoczMWGQGln9nv0pmm/riJQvB80CIQC9\nvXNZUbC6U5lSQ7eGhfmmHi1JAfb88wGau0AlreBczw==\n-----END CERTIFICATE-----\n",
                 "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",                 "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
-                "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAESqAtRvKPI24/floDNb5qpUHwCSCG+kXmGrUqcy94duXgiWv4TIOOVhmRue0Zv/GazL+04/y7Pn3xlf8mVHh9nA=="+                "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEq4PtK+6b5sRH0KzM20W3sBIyvmCPpV5rSgztIKuXJgwKfyvJoddD0n6IQiF9aukqaM216Lf+P6V45UXR+WmDYw=="
             }             }
         },         },
Ligne 1402: Ligne 1405:
  
 <code> <code>
-docker@manager1:/$ docker node ls +docker@manager1:~$ docker node ls                                                                                                                                                                             
-ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS +ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION 
-1f5qtolgtonqmhjk5ppwc8x1b     worker1             Ready               Active               +y0war0lijmwhnexrfhfflulsd *   manager1            Ready               Active              Leader              19.03.12 
-kmyjdwp9ojhzje4hlw7ffhuxv     worker2             Ready               Active               +v5ai62lmhfsdcauccqmjyu6qk     worker1             Ready               Active                                  19.03.12 
-oyszb44k8yw5btz3c1wq2ot2e     worker4             Ready               Active               +j4mr3d2ji30t7hu0trob5dpgz     worker2             Ready               Active                                  19.03.12 
-p6jpyopzzy0zg4znegi63hzjq     worker5             Ready               Active               +pouo7nuvirq0qkuvvrp04a47h     worker3             Ready               Active                                  19.03.12 
-yitkfnk99ecisrny9g3r9kfhk     worker3             Ready               Active               +mo0dd5ech6ifdgd8pa6cjz896     worker4             Ready               Active                                  19.03.12 
-yuwpmvtfmdxn8i7nllkyzkxkp *   manager1            Ready               Active              Leader+5am2vd39pybytu1nd3oooabtq     worker5             Ready               Active                                  19.03.12
 </code> </code>
  
Ligne 1415: Ligne 1418:
  
 <code> <code>
-docker@manager1:/$ docker service ps web+docker@manager1:~$ docker service ps web                                                                                                                                                                     
 ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS
-jkm2hapcthht        web.1               nginx:latest        worker3             Running             Running 25 minutes ago                        +son0vgc73drb        web.1               nginx:latest        worker4             Running             Running 12 minutes ago                        
-q55eqdhr1qf1        web.2               nginx:latest        worker4             Running             Running 25 minutes ago                        +ojqyweuo65jw        web.2               nginx:latest        worker5             Running             Running 12 minutes ago                        
-imqdkw4ei6gs        web.3               nginx:latest        manager1            Running             Running 25 minutes ago                        +mb40onnaxd0u        web.3               nginx:latest        manager1            Running             Running 12 minutes ago                        
-k4vjd0g7ijww        web.4               nginx:latest        worker1             Running             Running 25 minutes ago                        +4vwsho5x7i36        web.4               nginx:latest        worker2             Running             Running 12 minutes ago                        
-b7xbmy1npgf9        web.5               nginx:latest        worker2             Running             Running 25 minutes ago                        +sk9hr6j2u47c        web.5               nginx:latest        worker3             Running             Running 12 minutes ago                        
-kg3bivcg0wln        web.6               nginx:latest        worker5             Running             Running minutes ago                         +pui4dnkepu27        web.6               nginx:latest        worker1             Running             Running minutes ago                         
-ik3u0jfgey64        web.7               nginx:latest        worker5             Running             Running minutes ago                         +yj0kexdcuo5u        web.7               nginx:latest        worker5             Running             Running minutes ago                         
-6bw5ptw7xao8        web.8               nginx:latest        worker1             Running             Running minutes ago  +93jtbxqj2dyz        web.8               nginx:latest        worker1             Running             Running minutes ago   
 </code> </code>
  
Ligne 1430: Ligne 1433:
  
 <code> <code>
-docker@manager1:/$ docker node ps worker1 +docker@manager1:~$ docker node ps worker1                                                                                                                                                                     
-ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS +ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS 
-k4vjd0g7ijww        web.              nginx:latest        worker1             Running             Running 26 minutes ago                        +pui4dnkepu27        web.              nginx:latest        worker1             Running             Running minutes ago                        
-6bw5ptw7xao8        web.8               nginx:latest        worker1             Running             Running minutes ago       +93jtbxqj2dyz        web.8               nginx:latest        worker1             Running             Running minutes ago    
 </code> </code>
  
Ligne 1439: Ligne 1442:
  
 <code> <code>
-docker@manager1:/$ docker node update --availability drain worker1+docker@manager1:~$ docker node update --availability drain worker1                                                                                                                                           
 worker1 worker1
 </code> </code>
Ligne 1446: Ligne 1449:
  
 <code> <code>
-docker@manager1:/$ docker service ps web +docker@manager1:~$ docker service ps web                                                                                                                                                                      
-ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE             ERROR               PORTS +ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS 
-jkm2hapcthht        web.1               nginx:latest        worker3             Running             Running 29 minutes ago                         +son0vgc73drb        web.1               nginx:latest        worker4             Running             Running 14 minutes ago                        
-q55eqdhr1qf1        web.2               nginx:latest        worker4             Running             Running 29 minutes ago                         +ojqyweuo65jw        web.2               nginx:latest        worker5             Running             Running 14 minutes ago                        
-imqdkw4ei6gs        web.3               nginx:latest        manager1            Running             Running 29 minutes ago                         +mb40onnaxd0u        web.3               nginx:latest        manager1            Running             Running 14 minutes ago                        
-6cv6j4tz0nk5        web.4               nginx:latest        manager1            Running             Running 33 seconds ago                         +4vwsho5x7i36        web.4               nginx:latest        worker2             Running             Running 14 minutes ago                        
-k4vjd0g7ijww         \_ web.4           nginx:latest        worker1             Shutdown            Shutdown 33 seconds ago                        +sk9hr6j2u47c        web.5               nginx:latest        worker3             Running             Running 14 minutes ago                        
-b7xbmy1npgf9        web.              nginx:latest        worker2             Running             Running 29 minutes ago                         +ag41oh489h4t        web.              nginx:latest        manager1            Running             Running 3 seconds ago                         
-kg3bivcg0wln        web.6               nginx:latest        worker5             Running             Running 9 minutes ago                          +pui4dnkepu27         \_ web.6           nginx:latest        worker1             Shutdown            Shutdown 4 seconds ago                        
-ik3u0jfgey64        web.7               nginx:latest        worker5             Running             Running minutes ago                          +yj0kexdcuo5u        web.7               nginx:latest        worker5             Running             Running minutes ago                         
-wht3r8c9wga6        web.8               nginx:latest        worker4             Running             Running 33 seconds ago                         +kv7ax6cwzpkf        web.8               nginx:latest        worker2             Running             Running seconds ago                         
-6bw5ptw7xao8         \_ web.8           nginx:latest        worker1             Shutdown            Shutdown 33 seconds ago +93jtbxqj2dyz         \_ web.8           nginx:latest        worker1             Shutdown            Shutdown seconds ago  
 </code> </code>
  
Ligne 1465: Ligne 1468:
  
 <code> <code>
-docker@manager1:/$ docker service rm web+docker@manager1:~$ docker service rm web                                                                                                                                                                     
 web web
-</code> 
  
-<code> +docker@manager1:~$ docker service ls                                                                                                                                                                         
-docker@manager1:/$ docker service ls+
 ID                  NAME                MODE                REPLICAS            IMAGE               PORTS ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
-</code> 
  
-<code> +docker@manager1:~$ docker service inspect web                                                                                                                                                                
-docker@manager1:/$ docker service inspect web+
 [] []
 Status: Error: no such service: web, Code: 1 Status: Error: no such service: web, Code: 1
 </code> </code>
  
-Sortez de manager1 et démarrez le serveur VNC dans la machine virtuelle **debian9** en tant que **trainee** :+====3.11 - Sauvegarder Docker Swarm==== 
 + 
 +La configuration de Docker Swarm est contenue dans le répertoire **/var/lib/docker/swarm** de chaque Manager dans le Swarm :
  
 <code> <code>
-docker@manager1:/exit +docker@manager1:~sudo su -  
-root@debian9:~# exit +                                                                                                                                                                                 
-trainee@debian9:~$ vncserver +root@manager1:~# ls -l /var/lib/docker/swarm                                                                                                                                                                  
- +total 20 
-New 'X' desktop is debian9.i2tch.loc:+drwxr-xr-x    2 root     root          4096 Dec 16 13:38 certificates 
- +-rw-------    1 root     root           215 Dec 16 13:38 docker-state.json 
-Starting applications specified in /home/trainee/.vnc/xstartup +drwx------    4 root     root          4096 Dec 16 13:38 raft 
-Log file is /home/trainee/.vnc/debian9.i2tch.loc:1.log+-rw-------    root     root            70 Dec 16 13:38 state.json 
 +drwxr-xr-x    2 root     root          4096 Dec 16 13:38 worker
 </code> </code>
  
-====3.11 - Sauvegarder Docker Swarm==== +Le processus de sauvegarde necéssite qu'il y ait au moins **deux** Managers dans le Swarm. Le procédure de sauvegarde est :
- +
-La configuration de Docker Swarm est contenue dans le répertoire **/var/lib/docker/swarm** de chaque Manager dans le Swarm. Ce processus necéssite qu'il y ait au moins **deux** Managers dans le Swarm. Le procédure de sauvegarde est :+
  
   * arrêt du service Docker sur le Manager à sauvegarder,   * arrêt du service Docker sur le Manager à sauvegarder,
Ligne 1513: Ligne 1513:
 ----- -----
  
-Copyright © 2022 Hugh Norris.+Copyright © 2024 Hugh Norris.
Menu