Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:docker3:drf03 [2021/11/21 11:38] – created admin | elearning:workbooks:docker3:drf03 [2024/02/21 13:40] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2021.01** | + | Version : **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
Ligne 14: | Ligne 14: | ||
* 1.1 - Gestion Automatique par Docker | * 1.1 - Gestion Automatique par Docker | ||
* 1.2 - Gestion Manuelle d'un Volume | * 1.2 - Gestion Manuelle d'un Volume | ||
+ | * 1.3 - Gestion Manuelle d'un Bindmount | ||
* LAB #2 - Gestion du Réseau | * LAB #2 - Gestion du Réseau | ||
* 2.1 - L' | * 2.1 - L' | ||
Ligne 29: | Ligne 30: | ||
=====LAB #1 - Gestion des Volumes===== | =====LAB #1 - Gestion des Volumes===== | ||
- | Lancez | + | Lancez |
< | < | ||
- | root@debian9:~/mongodb# docker | + | root@debian11:~# docker |
- | e91a055283f4d67cbd91d11bb3faa6f67925893cb18f9cc25023e72e0f7ed85a | + | mongo2 |
</ | </ | ||
Ligne 41: | Ligne 42: | ||
< | < | ||
- | root@debian9:~# docker ps | + | root@debian11:~# docker ps |
- | CONTAINER ID IMAGE | + | CONTAINER ID |
- | b9773e4aa06d | + | 880733c6bdc3 |
</ | </ | ||
Ligne 49: | Ligne 50: | ||
< | < | ||
- | root@debian9:~# docker inspect mongo2 | + | root@debian11:~# docker inspect mongo2 |
... | ... | ||
" | " | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
" | " | ||
" | " | ||
Ligne 64: | Ligne 65: | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
" | " | ||
" | " | ||
Ligne 72: | Ligne 73: | ||
" | " | ||
} | } | ||
+ | ], | ||
... | ... | ||
" | " | ||
Ligne 83: | Ligne 85: | ||
< | < | ||
- | root@debian9:~# ls / | + | root@debian11:~# ls / |
- | journal | + | collection-0-2505194079268383602.wt |
+ | collection-2-2505194079268383602.wt | ||
+ | collection-4-2505194079268383602.wt | ||
+ | diagnostic.data | ||
+ | index-1-2505194079268383602.wt | ||
+ | index-3-2505194079268383602.wt | ||
</ | </ | ||
Ligne 90: | Ligne 97: | ||
< | < | ||
- | root@debian9:~# docker stop mongo2 | + | root@debian11:~# docker stop mongo2 |
mongo2 | mongo2 | ||
- | root@debian9: | + | |
- | CONTAINER ID IMAGE | + | root@debian11:~# docker rm mongo2 |
- | ea239635e141 | + | |
- | 21b0490a93dd | + | |
- | b9773e4aa06d | + | |
- | bdb4bc0f81de | + | |
- | f5b45072b831 | + | |
- | 9731a48f126a | + | |
- | eacd70596e23 | + | |
- | cffb4456e9c4 | + | |
- | root@debian9:~# docker rm mongo2 | + | |
mongo2 | mongo2 | ||
- | root@debian9: | ||
- | CONTAINER ID IMAGE | ||
- | ea239635e141 | ||
- | 21b0490a93dd | ||
- | bdb4bc0f81de | ||
- | f5b45072b831 | ||
- | 9731a48f126a | ||
- | eacd70596e23 | ||
- | cffb4456e9c4 | ||
</ | </ | ||
Ligne 118: | Ligne 107: | ||
< | < | ||
- | root@debian9:~# docker run -d --name mongo2 i2tch/ | + | root@debian11:~# docker run -d --name mongo2 i2tch/ |
- | a8382642c4e849337e12a60419b10f63ea21251dfcc2c6050284ca3eed7fa13d | + | 1980be05ac73d70979f5e932f1a58b6526ae1001a335fd8ca010bbfaac48ca5e |
- | root@debian9:~# docker ps -a | + | |
- | CONTAINER ID IMAGE | + | root@debian11:~# docker ps |
- | a8382642c4e8 | + | CONTAINER ID |
- | ea239635e141 | + | 1980be05ac73 |
- | 21b0490a93dd | + | |
- | bdb4bc0f81de | + | |
- | f5b45072b831 | + | |
- | 9731a48f126a | + | |
- | eacd70596e23 | + | |
- | cffb4456e9c4 | + | |
</ | </ | ||
Ligne 135: | Ligne 118: | ||
< | < | ||
- | root@debian9:~# docker inspect mongo2 | + | root@debian11:~# docker inspect mongo2 |
... | ... | ||
" | " | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
" | " | ||
" | " | ||
Ligne 150: | Ligne 133: | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
" | " | ||
" | " | ||
Ligne 158: | Ligne 141: | ||
" | " | ||
} | } | ||
+ | ], | ||
... | ... | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
- | **Important** : Notez que le répertoire des données du précédent conteneur, **/ | + | **Important** : Notez que le répertoire des données du précédent conteneur, **/ |
</ | </ | ||
Ligne 168: | Ligne 152: | ||
< | < | ||
- | root@debian9:~# ls -l / | + | root@debian11:~# ls -l / |
- | total 52 | + | total 60 |
- | drwxr-xr-x 3 root root 4096 Sep 7 09:43 3bf724ceb38ce0792469d7e403f05b6794f27e0aa72bda51a8ab75b2df5ae87c | + | drwx-----x 3 root root 4096 Dec 15 14:39 2ec1edeca3acd91aede62091e0d96252eb31e403a00fef324ca2244b2952bb48 |
- | drwxr-xr-x 3 root root 4096 Sep 6 16:07 46d11d005d05757609ff76159ce0992d210089c5247fa54b024706a20b0de501 | + | drwx-----x 3 root root 4096 Dec 10 17:12 396ad783162131dcc92a649366ab79e24720bf866ce6803868e2ba2df8e90074 |
- | drwxr-xr-x 3 root root 4096 Sep 7 09:43 76dcc0ccbe6604278cf8e8da0398a807f5d0719087f17c227c8504be24456d43 | + | drwx-----x 3 root root 4096 Dec 15 14:39 4abe232050675d853d0a4d8beefe31f884e1252c985828c3be47a983aac58605 |
- | drwxr-xr-x 3 root root 4096 Sep 7 02:33 9c84c2d1a0db811a3c13dce354ba21169f3073513c8d025dd96c5f902364d44a | + | drwx-----x 3 root root 4096 Dec 10 17:16 537cc5d0f0f0aa0af9dd959b45fc9fcbe8467a868b9d61919991366a2813f703 |
- | drwxr-xr-x 3 root root 4096 Sep 7 02:33 a6177cf4b46089356280f084dd2e272f673aa4a81accb53f031267fafcee6050 | + | drwx-----x 3 root root 4096 Dec 10 17:16 58795fb69d54b87b11fcb6ab752a1fa10736e5aa37c8a14b1c36db1306853a59 |
- | drwxr-xr-x 3 root root 4096 Sep 6 16:07 cc38fa97138adc55976aa16993d8920c5f7da922ad1b2a07936d30cc82d59f38 | + | drwx-----x 3 root root 4096 Dec 10 18:32 7d7b25232f6ec411dc9dfb888048eebbee919eb2cedc301969bc325a8a8d055e |
- | -rw------- 1 root root 32768 Sep 7 09:43 metadata.db | + | brw------- 1 root root 8, 33 Dec 15 09:56 backingFsBlockDev |
+ | drwx-----x 3 root root 4096 Dec 10 17:12 f766fb3cd11eee28312b8804c1439c0f7b0a7d58a0ce4d61ba50af17b7630c8f | ||
+ | -rw------- 1 root root 65536 Dec 15 14:39 metadata.db | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que non-seulement ceci représente une source de perte d' | **Important** : Notez que non-seulement ceci représente une source de perte d' | ||
</ | </ | ||
Ligne 188: | Ligne 174: | ||
< | < | ||
- | root@debian9:~# docker stop mongo2 | + | root@debian11:~# docker stop mongo2 |
mongo2 | mongo2 | ||
- | root@debian9:~# docker rm mongo2 | + | |
+ | root@debian11:~# docker rm mongo2 | ||
mongo2 | mongo2 | ||
- | root@debian9:~# docker run -d --name mongo2 -v persistent_data:/ | + | |
- | 3cf093d72b9e3739f2cb288e571244e494b7518292c31994ee012e3620bb0e98 | + | root@debian11:~# docker run -d --name mongo2 -v persistent_data:/ |
- | root@debian9:~# docker ps -a | + | 8b2207df56a727a8472b2949d7a83a1925e751ad0216fe98b6a3db83230c0988 |
- | CONTAINER ID IMAGE | + | |
- | 3cf093d72b9e | + | root@debian11:~# docker ps |
- | ea239635e141 | + | CONTAINER ID |
- | 21b0490a93dd | + | 8b2207df56a7 |
- | bdb4bc0f81de | + | |
- | f5b45072b831 | + | root@debian11:~# docker logs mongo2 |
- | 9731a48f126a | + | 2023-12-15T13:45:40.845+0000 I CONTROL |
- | eacd70596e23 | + | 2023-12-15T13: |
- | cffb4456e9c4 | + | 2023-12-15T13:45:40.847+0000 I CONTROL |
- | root@debian9:~# docker logs mongo2 | + | 2023-12-15T13:45:40.847+0000 I CONTROL |
- | 2017-09-07T08:53:12.523+0000 I CONTROL | + | 2023-12-15T13:45:40.847+0000 I CONTROL |
- | 2017-09-07T08:53:12.524+0000 I CONTROL | + | 2023-12-15T13: |
- | 2017-09-07T08:53:12.524+0000 I CONTROL | + | 2023-12-15T13: |
- | 2017-09-07T08:53:12.524+0000 I CONTROL | + | 2023-12-15T13:45:40.847+0000 I CONTROL |
- | 2017-09-07T08:53:12.524+0000 I CONTROL | + | 2023-12-15T13:45:40.847+0000 I CONTROL |
- | 2017-09-07T08:53:12.524+0000 I CONTROL | + | 2023-12-15T13: |
- | 2017-09-07T08:53:12.535+0000 I JOURNAL | + | 2023-12-15T13:45:40.847+0000 I CONTROL |
- | 2017-09-07T08:53:12.535+0000 I JOURNAL | + | 2023-12-15T13:45:40.847+0000 I CONTROL |
- | 2017-09-07T08:53:13.368+0000 I JOURNAL | + | 2023-12-15T13:45:40.847+0000 I STORAGE |
- | 2017-09-07T08:53:14.410+0000 I JOURNAL | + | 2023-12-15T13: |
- | 2017-09-07T08:53:16.277+0000 I JOURNAL | + | 2023-12-15T13: |
- | 2017-09-07T08:53:16.277+0000 I JOURNAL | + | 2023-12-15T13:45:40.847+0000 I STORAGE |
- | 2017-09-07T08:53:16.277+0000 I JOURNAL | + | 2023-12-15T13: |
- | 2017-09-07T08:53:19.930+0000 I JOURNAL | + | 2023-12-15T13:45:41.665+0000 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, |
- | 2017-09-07T08:53:23.035+0000 I JOURNAL | + | 2023-12-15T13: |
- | 2017-09-07T08:53:25.889+0000 I JOURNAL | + | 2023-12-15T13: |
- | 2017-09-07T08:53:25.889+0000 I JOURNAL | + | 2023-12-15T13:45:41.727+0000 I CONTROL |
- | 2017-09-07T08:53:26.016+0000 I INDEX [initandlisten] | + | 2023-12-15T13:45:41.727+0000 I CONTROL |
- | 2017-09-07T08:53:26.246+0000 I STORAGE | + | 2023-12-15T13:45:41.727+0000 I CONTROL |
- | 2017-09-07T08:53:26.246+0000 I STORAGE | + | 2023-12-15T13: |
- | 2017-09-07T08:53:26.256+0000 I STORAGE | + | 2023-12-15T13:45:41.727+0000 I CONTROL |
- | 2017-09-07T08:53:26.299+0000 I NETWORK | + | 2023-12-15T13:45:41.727+0000 I CONTROL |
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13:45:41.727+0000 I CONTROL | ||
+ | 2023-12-15T13:45:41.727+0000 I CONTROL | ||
+ | 2023-12-15T13:45:41.727+0000 I CONTROL | ||
+ | 2023-12-15T13:45:41.728+0000 I STORAGE | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13:45:41.819+0000 I STORAGE | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13:45:41.856+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory | ||
+ | 2023-12-15T13:45:41.857+0000 I NETWORK | ||
+ | 2023-12-15T13:45: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13:45:41.857+0000 I NETWORK | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
+ | 2023-12-15T13: | ||
</ | </ | ||
Ligne 232: | Ligne 244: | ||
< | < | ||
- | root@debian9:~# ls -l / | + | root@debian11:~# ls -l / |
total 68 | total 68 | ||
- | drwxr-xr-x 3 root root 4096 Sep 7 09:43 3bf724ceb38ce0792469d7e403f05b6794f27e0aa72bda51a8ab75b2df5ae87c | + | drwx-----x 3 root root 4096 Dec 15 14:39 2ec1edeca3acd91aede62091e0d96252eb31e403a00fef324ca2244b2952bb48 |
- | drwxr-xr-x 3 root root 4096 Sep 6 16:07 46d11d005d05757609ff76159ce0992d210089c5247fa54b024706a20b0de501 | + | drwx-----x 3 root root 4096 Dec 10 17:12 396ad783162131dcc92a649366ab79e24720bf866ce6803868e2ba2df8e90074 |
- | drwxr-xr-x 3 root root 4096 Sep 7 09:46 511e23f818d5cf60f4333a3fe8fd2e4333c900dec6eee97f70448bfb0091184d | + | drwx-----x 3 root root 4096 Dec 15 14:39 4abe232050675d853d0a4d8beefe31f884e1252c985828c3be47a983aac58605 |
- | drwxr-xr-x 3 root root 4096 Sep 7 09:53 5ca72be4140ecf1271efe7342cf7cd58ce66fc3673d12c04b8503603b8cee66c | + | drwx-----x 3 root root 4096 Dec 10 17:16 537cc5d0f0f0aa0af9dd959b45fc9fcbe8467a868b9d61919991366a2813f703 |
- | drwxr-xr-x 3 root root 4096 Sep 7 09:43 76dcc0ccbe6604278cf8e8da0398a807f5d0719087f17c227c8504be24456d43 | + | drwx-----x 3 root root 4096 Dec 10 17:16 58795fb69d54b87b11fcb6ab752a1fa10736e5aa37c8a14b1c36db1306853a59 |
- | drwxr-xr-x 3 root root 4096 Sep 7 02:33 9c84c2d1a0db811a3c13dce354ba21169f3073513c8d025dd96c5f902364d44a | + | drwx-----x 3 root root 4096 Dec 10 18:32 7d7b25232f6ec411dc9dfb888048eebbee919eb2cedc301969bc325a8a8d055e |
- | drwxr-xr-x 3 root root 4096 Sep 7 02:33 a6177cf4b46089356280f084dd2e272f673aa4a81accb53f031267fafcee6050 | + | brw------- 1 root root 8, 33 Dec 15 09:56 backingFsBlockDev |
- | drwxr-xr-x 3 root root 4096 Sep 6 16:07 cc38fa97138adc55976aa16993d8920c5f7da922ad1b2a07936d30cc82d59f38 | + | drwx-----x 3 root root 4096 Dec 10 17:12 f766fb3cd11eee28312b8804c1439c0f7b0a7d58a0ce4d61ba50af17b7630c8f |
- | -rw------- 1 root root 65536 Sep 7 09:53 metadata.db | + | drwx-----x 3 root root 4096 Dec 15 14:45 fa3330b3415f534a7d0053ba95d74fe02765cde317c11cac9691c3132cec3d47 |
- | drwxr-xr-x 3 root root 4096 Sep 7 09:46 persistent_data | + | -rw------- 1 root root 65536 Dec 15 14:45 metadata.db |
+ | drwx-----x 3 root root 4096 Dec 15 14:45 persistent_data | ||
</ | </ | ||
Ligne 249: | Ligne 262: | ||
< | < | ||
- | root@debian9:~# docker stop mongo2 | + | root@debian11:~# docker stop mongo2 |
mongo2 | mongo2 | ||
- | root@debian9:~# docker rm mongo2 | + | |
+ | root@debian11:~# docker rm mongo2 | ||
mongo2 | mongo2 | ||
- | root@debian9:~# docker run -d --name mongo2 -v persistent_data:/ | + | |
- | ad672c3038245c25a36162d05820c21f7250557ac342582d0908d3ca33799e37 | + | root@debian11:~# docker run -d --name mongo2 -v persistent_data:/ |
- | root@debian9:~# docker ps -a | + | cc7cc8f3b43346fe47cc5107225b0b98851a73a9b2938530077ca7a3207581a0 |
- | CONTAINER ID IMAGE | + | |
- | ad672c303824 | + | root@debian11:~# docker ps |
- | ea239635e141 | + | CONTAINER ID |
- | 21b0490a93dd | + | cc7cc8f3b433 |
- | bdb4bc0f81de | + | |
- | f5b45072b831 | + | |
- | 9731a48f126a | + | |
- | eacd70596e23 | + | |
- | cffb4456e9c4 | + | |
</ | </ | ||
Ligne 270: | Ligne 279: | ||
< | < | ||
- | root@debian9:~# docker inspect mongo2 | + | root@debian11:~# docker inspect mongo2 |
... | ... | ||
" | " | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
Ligne 285: | Ligne 294: | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
} | } | ||
+ | ], | ||
... | ... | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez ici que l' | **Important** : Notez ici que l' | ||
</ | </ | ||
Ligne 303: | Ligne 313: | ||
< | < | ||
- | root@debian9:~# docker volume create myvolume | + | root@debian11:~# docker volume create myvolume |
myvolume | myvolume | ||
</ | </ | ||
Ligne 310: | Ligne 320: | ||
< | < | ||
- | root@debian9:~# docker volume ls | + | root@debian11:~# docker volume ls |
- | DRIVER | + | DRIVER |
- | local | + | local 2ec1edeca3acd91aede62091e0d96252eb31e403a00fef324ca2244b2952bb48 |
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local myvolume | ||
+ | local | ||
</ | </ | ||
Ligne 318: | Ligne 338: | ||
< | < | ||
- | root@debian9:~# docker volume inspect myvolume | + | root@debian11:~# docker volume inspect myvolume |
[ | [ | ||
{ | { | ||
- | " | + | " |
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
- | " | + | " |
" | " | ||
} | } | ||
Ligne 335: | Ligne 355: | ||
< | < | ||
- | root@debian9:~# touch / | + | root@debian11:~# touch / |
</ | </ | ||
Ligne 341: | Ligne 361: | ||
< | < | ||
- | root@debian9:~# docker run -it --name ubuntu-volume --mount source=myvolume, | + | root@debian11:~# docker run -it --name ubuntu-volume --mount source=myvolume, |
- | root@673f9c8bc837:/# | + | |
- | bin boot dev etc home lib lib32 lib64 libx32 | + | |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez l' | **Important** : Notez l' | ||
</ | </ | ||
Ligne 353: | Ligne 371: | ||
< | < | ||
- | root@673f9c8bc837:/# cd myvolume/ | + | root@ff76d3820051:/# cd myvolume/ |
- | root@673f9c8bc837:/myvolume# ls | + | root@ff76d3820051:/myvolume# ls |
test-file | test-file | ||
</ | </ | ||
Ligne 361: | Ligne 379: | ||
< | < | ||
- | root@673f9c8bc837:/myvolume# touch container_volume | + | root@ff76d3820051:/myvolume# touch container_volume |
- | root@673f9c8bc837:/myvolume# exit | + | root@ff76d3820051:/myvolume# exit |
+ | exit | ||
+ | root@debian11: | ||
</ | </ | ||
Ligne 368: | Ligne 388: | ||
< | < | ||
- | root@debian9:~# ls -l / | + | root@debian11:~# ls -l / |
total 0 | total 0 | ||
- | -rw-r--r-- 1 root root 0 avril 15 10:22 container_volume | + | -rw-r--r-- 1 root root 0 Dec 15 14:55 container_volume |
- | -rw-r--r-- 1 root root 0 avril 15 10:16 test-file | + | -rw-r--r-- 1 root root 0 Dec 15 14:51 test-file |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que les deux fichiers témoins sont visibles. | **Important** : Notez que les deux fichiers témoins sont visibles. | ||
</ | </ | ||
< | < | ||
- | root@debian9:~# docker rm ubuntu-volume | + | root@debian11:~# docker rm ubuntu-volume |
ubuntu-volume | ubuntu-volume | ||
- | root@debian9:~# ls -l / | + | |
+ | root@debian11:~# ls -l / | ||
total 0 | total 0 | ||
- | -rw-r--r-- 1 root root 0 avril 15 10:22 container_volume | + | -rw-r--r-- 1 root root 0 Dec 15 14:55 container_volume |
- | -rw-r--r-- 1 root root 0 avril 15 10:16 test-file | + | -rw-r--r-- 1 root root 0 Dec 15 14:51 test-file |
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que les deux fichiers témoins sont toujours visibles. | **Important** : Notez que les deux fichiers témoins sont toujours visibles. | ||
</ | </ | ||
Ligne 394: | Ligne 415: | ||
< | < | ||
- | root@debian9:~# docker run -it --rm --name ubuntu-volume --mount source=myvolume1, | + | root@debian11:~# docker run -it --rm --name ubuntu-volume --mount source=myvolume1, |
- | root@b1476960de63:/# ls | + | |
- | bin | + | root@5547f3231534:/# ls |
- | root@b1476960de63:/# cd myvolume1 | + | bin |
- | root@b1476960de63:/ | + | boot etc lib |
- | root@b1476960de63:/ | + | |
+ | root@5547f3231534:/# cd myvolume1 | ||
+ | |||
+ | root@5547f3231534:/ | ||
+ | |||
+ | root@5547f3231534:/ | ||
exit | exit | ||
+ | root@debian11: | ||
</ | </ | ||
Ligne 406: | Ligne 433: | ||
< | < | ||
- | root@debian9:~# docker volume ls | + | root@debian11:~# docker volume ls |
- | DRIVER | + | DRIVER |
- | local | + | local 2ec1edeca3acd91aede62091e0d96252eb31e403a00fef324ca2244b2952bb48 |
- | local | + | local |
- | root@debian9:~# ls -l / | + | local |
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local myvolume | ||
+ | local | ||
+ | local | ||
+ | |||
+ | root@debian11:~# ls -l / | ||
total 0 | total 0 | ||
- | -rw-r--r-- 1 root root 0 avril 15 12:06 file_myvolume1 | + | -rw-r--r-- 1 root root 0 Dec 15 15:01 file_myvolume1 |
</ | </ | ||
+ | |||
+ | ====1.3 - Gestion Manuelle d'un Bindmount==== | ||
Un autre type de volume utilisable avec Docker est le **Bindmount**. Un Bindmount : | Un autre type de volume utilisable avec Docker est le **Bindmount**. Un Bindmount : | ||
Ligne 423: | Ligne 463: | ||
< | < | ||
- | root@debian9:~# mkdir bindmount | + | root@debian11:~# mkdir bindmount |
- | root@debian9:~# touch bindmount/ | + | root@debian11:~# touch bindmount/ |
</ | </ | ||
Ligne 430: | Ligne 470: | ||
< | < | ||
- | root@debian9:~# docker run -it --name ubuntu-volume --mount type=bind, | + | root@debian11:~# docker run -it --name ubuntu-volume --mount type=bind, |
- | root@7b13fe558984:/# ls | + | |
- | bin | + | root@1cd3cc50e6c0:/# ls |
- | root@7b13fe558984:/# cd bindmount | + | bin |
- | root@7b13fe558984:/ | + | bindmount |
+ | |||
+ | root@1cd3cc50e6c0:/# cd bindmount/ | ||
+ | |||
+ | root@1cd3cc50e6c0:/ | ||
test_bind | test_bind | ||
- | root@7b13fe558984:/ | + | |
- | root@7b13fe558984:/ | + | root@1cd3cc50e6c0:/ |
+ | |||
+ | root@1cd3cc50e6c0:/ | ||
container_bind | container_bind | ||
- | root@7b13fe558984:/ | + | |
+ | root@1cd3cc50e6c0:/ | ||
exit | exit | ||
+ | root@debian11: | ||
</ | </ | ||
- | Conrôlez | + | Contrôlez |
< | < | ||
- | root@debian9:~# ls -l bindmount/ | + | root@debian11:~# ls -l bindmount/ |
total 0 | total 0 | ||
- | -rw-r--r-- 1 root root 0 avril 15 10:32 container_bind | + | -rw-r--r-- 1 root root 0 Dec 15 15:27 container_bind |
- | -rw-r--r-- 1 root root 0 avril 15 10:32 test_bind | + | -rw-r--r-- 1 root root 0 Dec 15 15:25 test_bind |
- | root@debian9:~# docker rm ubuntu-volume | + | |
+ | root@debian11:~# docker rm ubuntu-volume | ||
ubuntu-volume | ubuntu-volume | ||
- | root@debian9:~# ls -l bindmount/ | + | |
+ | root@debian11:~# ls -l bindmount/ | ||
total 0 | total 0 | ||
- | -rw-r--r-- 1 root root 0 avril 15 10:32 container_bind | + | -rw-r--r-- 1 root root 0 Dec 15 15:27 container_bind |
- | -rw-r--r-- 1 root root 0 avril 15 10:32 test_bind | + | -rw-r--r-- 1 root root 0 Dec 15 15:25 test_bind |
</ | </ | ||
Ligne 461: | Ligne 511: | ||
< | < | ||
- | root@debian9:~# docker volume ls | + | root@debian11:~# docker volume ls |
- | DRIVER | + | DRIVER |
- | local | + | local 2ec1edeca3acd91aede62091e0d96252eb31e403a00fef324ca2244b2952bb48 |
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local | ||
+ | local myvolume | ||
+ | local | ||
+ | local | ||
</ | </ | ||
- | |||
=====LAB #2 - Gestion du Réseau===== | =====LAB #2 - Gestion du Réseau===== | ||
Ligne 474: | Ligne 534: | ||
< | < | ||
- | root@debian9:~# docker network ls | + | root@debian11:~# docker network ls |
- | NETWORK ID NAME DRIVER | + | NETWORK ID |
- | 495b3db75b0d | + | 2473b0d9324a |
- | e1ed4de2f947 | + | b0a285caf920 |
- | 6bda460c97c6 | + | a2da9933cdce |
</ | </ | ||
Ligne 488: | Ligne 548: | ||
< | < | ||
- | root@debian9:~# ip addr show docker0 | + | root@debian11:~# ip addr show docker0 |
- | 3: docker0: <NO-CARRIER,BROADCAST, | + | 3: docker0: < |
- | link/ether 02:42:38:f1:e7:ee brd ff: | + | link/ether 02:42:07:c9:88:32 brd ff: |
inet 172.17.0.1/ | inet 172.17.0.1/ | ||
+ | | ||
+ | inet6 fe80:: | ||
| | ||
</ | </ | ||
Ligne 498: | Ligne 560: | ||
< | < | ||
- | root@debian9:~# docker run -itd --name=resotest centos | + | root@debian11:~# docker run -itd --name=resotest centos |
- | 2169360fcbfdbd6e68ea969a95edeb6fc42603c23ee42f03ceec286276519855 | + | 2126924504d8dedb920728cc7c2a6c73e87f8c5c3d13c17c4fcc2bfe8ff93cc9 |
</ | </ | ||
Ligne 505: | Ligne 567: | ||
< | < | ||
- | root@debian9:~# docker network inspect bridge | + | root@debian11:~# docker network inspect bridge |
[ | [ | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
" | " | ||
Ligne 532: | Ligne 594: | ||
" | " | ||
" | " | ||
- | "2169360fcbfdbd6e68ea969a95edeb6fc42603c23ee42f03ceec286276519855": { | + | "2126924504d8dedb920728cc7c2a6c73e87f8c5c3d13c17c4fcc2bfe8ff93cc9": { |
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
" | " | ||
}, | }, | ||
- | "ad672c3038245c25a36162d05820c21f7250557ac342582d0908d3ca33799e37": { | + | "cc7cc8f3b43346fe47cc5107225b0b98851a73a9b2938530077ca7a3207581a0": { |
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
Ligne 560: | Ligne 622: | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez ici que les conteneurs **mongo2** et **resotest** ne disposent pas de la même adresse que l' | **Important** : Notez ici que les conteneurs **mongo2** et **resotest** ne disposent pas de la même adresse que l' | ||
</ | </ | ||
Ligne 567: | Ligne 629: | ||
< | < | ||
- | root@debian9:~# docker network disconnect bridge resotest | + | root@debian11:~# docker network disconnect bridge resotest |
- | root@debian9:~# docker network inspect bridge | + | |
+ | root@debian11:~# docker network inspect bridge | ||
[ | [ | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
" | " | ||
Ligne 595: | Ligne 658: | ||
" | " | ||
" | " | ||
- | "ad672c3038245c25a36162d05820c21f7250557ac342582d0908d3ca33799e37": { | + | "cc7cc8f3b43346fe47cc5107225b0b98851a73a9b2938530077ca7a3207581a0": { |
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
Ligne 619: | Ligne 682: | ||
< | < | ||
- | root@debian9:~# docker network create -d bridge --subnet 172.25.0.0/ | + | root@debian11:~# docker network create -d bridge --subnet 172.25.0.0/ |
- | ceb7ba7493933c55d181bc92b1f799ca07bfe84b168d52a6ac648c1a906093f3 | + | 4d26c1192dd7b25c3c787ef41b7bfb94d0eb989d230f33906db6d54ed9c128cc |
- | root@debian9:~# docker network ls | + | |
- | NETWORK ID NAME | + | root@debian11:~# docker network ls |
- | 495b3db75b0d | + | NETWORK ID |
- | e1ed4de2f947 | + | 2473b0d9324a |
- | ceb7ba749393 | + | b0a285caf920 |
- | 6bda460c97c6 | + | 4d26c1192dd7 |
+ | a2da9933cdce | ||
</ | </ | ||
Ligne 632: | Ligne 696: | ||
< | < | ||
- | root@debian9:~# docker network inspect my-bridged-network | + | root@debian11:~# docker network inspect my-bridged-network |
[ | [ | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
" | " | ||
Ligne 668: | Ligne 732: | ||
< | < | ||
- | root@debian9:~# docker run -itd --name=centos1 centos | + | root@debian11:~# docker run -itd --name=centos1 centos |
- | 9f36a628c72b383edfd4dc13ee4e4b2eaf5be0078d780f0334fcb8be0d977d0e | + | cb2875ab1059e66308228d9179b810db748ad287453cf758206a7025f57b0176 |
- | root@debian9:~# docker run -itd --name=centos2 centos | + | root@debian11:~# docker run -itd --name=centos2 centos |
- | aaed3bc8e404ee1bccd6c87b39de32332940b5391514691fc70188edb17c1d7c | + | fc417b22a20d3f9de674889962452bfe453ced1fc389410b225055f865cb817f |
- | root@debian9:~# docker inspect --format=' | + | root@debian11:~# docker inspect --format=' |
- | {" | + | {" |
- | root@debian9:~# docker inspect --format=' | + | root@debian11:~# docker inspect --format=' |
- | {" | + | {" |
- | root@debian9:~# docker inspect --format=' | + | root@debian11:~# docker inspect --format=' |
172.17.0.3 | 172.17.0.3 | ||
- | root@debian9:~# docker inspect --format=' | + | root@debian11:~# docker inspect --format=' |
172.17.0.4 | 172.17.0.4 | ||
</ | </ | ||
Ligne 690: | Ligne 754: | ||
< | < | ||
- | root@debian9:~# docker network connect my-bridged-network centos1 | + | root@debian11:~# docker network connect my-bridged-network centos1 |
- | root@debian9:~# docker network inspect my-bridged-network | + | root@debian11:~# docker network inspect my-bridged-network |
[ | [ | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
" | " | ||
Ligne 719: | Ligne 783: | ||
" | " | ||
" | " | ||
- | "9f36a628c72b383edfd4dc13ee4e4b2eaf5be0078d780f0334fcb8be0d977d0e": { | + | "cb2875ab1059e66308228d9179b810db748ad287453cf758206a7025f57b0176": { |
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
Ligne 732: | Ligne 796: | ||
] | ] | ||
- | root@debian9:~# docker inspect --format=' | + | root@debian11:~# docker inspect --format=' |
172.17.0.3172.25.0.2 | 172.17.0.3172.25.0.2 | ||
</ | </ | ||
- | <WRAP center round important> | + | <WRAP center round important |
**Important** : Notez que le conteneur **centos1** se trouve dans deux réseaux. | **Important** : Notez que le conteneur **centos1** se trouve dans deux réseaux. | ||
</ | </ | ||
Ligne 743: | Ligne 807: | ||
< | < | ||
- | root@debian9:~# docker network connect my-bridged-network centos2 | + | root@debian11:~# docker network connect my-bridged-network centos2 |
- | root@debian9:~# docker network inspect my-bridged-network | + | root@debian11:~# docker network inspect my-bridged-network |
[ | [ | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
" | " | ||
" | " | ||
Ligne 772: | Ligne 836: | ||
" | " | ||
" | " | ||
- | "9f36a628c72b383edfd4dc13ee4e4b2eaf5be0078d780f0334fcb8be0d977d0e": { | + | "cb2875ab1059e66308228d9179b810db748ad287453cf758206a7025f57b0176": { |
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
" | " | ||
}, | }, | ||
- | "aaed3bc8e404ee1bccd6c87b39de32332940b5391514691fc70188edb17c1d7c": { | + | "fc417b22a20d3f9de674889962452bfe453ced1fc389410b225055f865cb817f": { |
" | " | ||
- | " | + | " |
" | " | ||
" | " | ||
Ligne 792: | Ligne 856: | ||
] | ] | ||
- | root@debian9:~# docker inspect --format=' | + | root@debian11:~# docker inspect --format=' |
172.17.0.4172.25.0.3 | 172.17.0.4172.25.0.3 | ||
</ | </ | ||
Ligne 799: | Ligne 863: | ||
< | < | ||
- | root@debian9:~# docker exec -it centos1 bash | + | root@debian11:~# docker exec -it centos1 bash |
+ | [root@cb2875ab1059 /]# | ||
</ | </ | ||
Ligne 805: | Ligne 870: | ||
< | < | ||
- | [root@9f36a628c72b | + | [root@cb2875ab1059 |
PING 172.25.0.3 (172.25.0.3) 56(84) bytes of data. | PING 172.25.0.3 (172.25.0.3) 56(84) bytes of data. | ||
- | 64 bytes from 172.25.0.3: icmp_seq=1 ttl=64 time=0.100 ms | + | 64 bytes from 172.25.0.3: icmp_seq=1 ttl=64 time=0.140 ms |
- | 64 bytes from 172.25.0.3: icmp_seq=2 ttl=64 time=0.050 ms | + | 64 bytes from 172.25.0.3: icmp_seq=2 ttl=64 time=0.099 ms |
- | 64 bytes from 172.25.0.3: icmp_seq=3 ttl=64 time=0.050 | + | |
^C | ^C | ||
--- 172.25.0.3 ping statistics --- | --- 172.25.0.3 ping statistics --- | ||
- | 3 packets transmitted, | + | 2 packets transmitted, |
- | rtt min/ | + | rtt min/ |
</ | </ | ||
Ligne 821: | Ligne 885: | ||
< | < | ||
- | [root@9f36a628c72b | + | [root@cb2875ab1059 |
exit | exit | ||
- | root@debian9:~# docker stop mongo2 | + | |
+ | root@debian11:~# docker stop mongo2 | ||
mongo2 | mongo2 | ||
- | root@debian9:~# docker rm mongo2 | + | |
+ | root@debian11:~# docker rm mongo2 | ||
mongo2 | mongo2 | ||
- | root@debian9:~# docker run -it --name mongo2 --dns 8.8.8.8 i2tch/ | + | |
- | root@735599480b45:/# cat / | + | root@debian11:~# docker run -it --name mongo2 --dns 8.8.8.8 i2tch/ |
- | search home | + | |
+ | root@aa2717305397:/# cat / | ||
nameserver 8.8.8.8 | nameserver 8.8.8.8 | ||
- | root@735599480b45:/# | ||
</ | </ | ||
Ligne 837: | Ligne 903: | ||
< | < | ||
- | root@735599480b45:/# exit | + | root@aa2717305397:/# exit |
exit | exit | ||
- | root@debian9:~# docker stop mongo2 | + | |
+ | root@debian11:~# docker stop mongo2 | ||
mongo2 | mongo2 | ||
- | root@debian9:~# docker rm mongo2 | + | |
+ | root@debian11:~# docker rm mongo2 | ||
mongo2 | mongo2 | ||
- | root@debian9:~# docker run -it --name mongo2 --add-host mickeymouse: | + | |
- | root@718e7eab814f:/# cat / | + | root@debian11:~# docker run -it --name mongo2 --add-host mickeymouse: |
- | 127.0.0.1 localhost | + | root@519423c7fb32:/# cat / |
- | :: | + | 127.0.0.1 |
- | fe00:: | + | ::1 |
- | ff00:: | + | fe00::0 ip6-localnet |
- | ff02:: | + | ff00::0 ip6-mcastprefix |
- | ff02:: | + | ff02::1 ip6-allnodes |
- | 127.0.0.1 mickeymouse | + | ff02::2 ip6-allrouters |
- | 172.17.0.2 718e7eab814f | + | 127.0.0.1 |
+ | 172.17.0.2 | ||
+ | |||
+ | root@519423c7fb32:/# | ||
+ | exit | ||
+ | root@debian11: | ||
</ | </ | ||
Ligne 859: | Ligne 932: | ||
Ce type de réseau est utilisé dans le cas où le réseau ne doit pas être isolé de l' | Ce type de réseau est utilisé dans le cas où le réseau ne doit pas être isolé de l' | ||
- | Dans le cas de la machine virtuelle, l' | + | Dans le cas de la machine virtuelle, l' |
< | < | ||
- | root@debian9:~# ip addr show ens18 | + | root@debian11:~# ip addr show ens18 |
2: ens18: < | 2: ens18: < | ||
- | link/ | + | link/ |
- | inet 10.0.2.60/24 brd 10.0.2.255 scope global | + | altname enp0s18 |
- | | + | inet 10.0.2.46/24 brd 10.0.2.255 scope global |
- | inet6 fe80::a00:27ff:fe2e:7701/64 scope link | + | |
+ | inet6 fe80::54a3:fdff:fe18:26d/64 scope link noprefixroute | ||
| | ||
</ | </ | ||
Ligne 874: | Ligne 948: | ||
< | < | ||
- | root@debian9:~# docker run -it --rm --network host --name centos3 centos bash | + | root@debian11:~# docker run -it --rm --network host --name centos3 centos bash |
- | [root@debian9 | + | |
- | 1: lo: < | + | [root@debian11 |
+ | 1: lo: < | ||
link/ | link/ | ||
inet 127.0.0.1/8 scope host lo | inet 127.0.0.1/8 scope host lo | ||
Ligne 883: | Ligne 958: | ||
| | ||
2: ens18: < | 2: ens18: < | ||
- | link/ | + | link/ |
- | inet 10.0.2.60/24 brd 10.0.2.255 scope global | + | altname enp0s18 |
- | | + | inet 10.0.2.46/24 brd 10.0.2.255 scope global |
- | inet6 fe80:: | + | |
| | ||
- | 3: docker0: <NO-CARRIER,BROADCAST, | + | inet6 fe80:: |
- | link/ether 02:42:38:f1:e7:ee brd ff: | + | |
+ | 3: docker0: < | ||
+ | link/ether 02:42:07:c9:88:32 brd ff: | ||
inet 172.17.0.1/ | inet 172.17.0.1/ | ||
| | ||
- | inet6 fe80::42:38ff:fef1:e7ee/64 scope link | + | inet6 fe80::42:7ff:fec9:8832/64 scope link |
| | ||
- | [root@debian9 | + | 102: br-4d26c1192dd7: |
- | debian9 | + | link/ether 02: |
- | [root@debian9 | + | inet 172.25.0.1/ |
+ | | ||
+ | inet6 fe80:: | ||
+ | | ||
+ | 104: vethc5ca04a@if103: | ||
+ | link/ether 42: | ||
+ | inet6 fe80:: | ||
+ | | ||
+ | 106: veth6a46250@if105: | ||
+ | link/ether 5e: | ||
+ | inet6 fe80:: | ||
+ | | ||
+ | 108: vethc5ccfca@if107: | ||
+ | link/ether f2: | ||
+ | inet6 fe80:: | ||
+ | | ||
+ | 110: vetha87ff61@if109: | ||
+ | link/ether 2e: | ||
+ | inet6 fe80:: | ||
+ | | ||
+ | |||
+ | [root@debian11 | ||
+ | debian11 | ||
+ | |||
+ | [root@debian11 | ||
+ | exit | ||
+ | root@debian11: | ||
</ | </ | ||
- | Le but de ce type de réseau est de permettre l' | + | Le but de ce type de réseau est de permettre l' |
Pour cette raison, dans le cas de l' | Pour cette raison, dans le cas de l' | ||
Ligne 914: | Ligne 1016: | ||
< | < | ||
- | root@718e7eab814f:/# | + | root@debian11:~# docker stop mongo2 |
- | exit | + | |
- | root@debian9:~# docker stop mongo2 | + | |
mongo2 | mongo2 | ||
- | root@debian9:~# docker rm mongo2 | + | root@debian11:~# docker rm mongo2 |
mongo2 | mongo2 | ||
- | root@debian9:~# docker run -it --name mongo2 --network none i2tch/ | + | root@debian11:~# docker run -it --name mongo2 --network none i2tch/ |
- | root@332aa9930f30:/# | + | root@5bfbf0306ad7:/# |
- | </ | + | |
===Liens=== | ===Liens=== | ||
Ligne 950: | Ligne 1049: | ||
cffb4456e9c4 | cffb4456e9c4 | ||
- | root@debian9:~# docker exec -it centos3 bash | + | root@debian11:~# docker exec -it centos3 bash |
- | [root@6a315259b294 | + | [root@57e92a8b25d7 |
PING alias (172.17.0.4) 56(84) bytes of data. | PING alias (172.17.0.4) 56(84) bytes of data. | ||
- | 64 bytes from alias (172.17.0.4): | + | 64 bytes from alias (172.17.0.4): |
- | 64 bytes from alias (172.17.0.4): | + | 64 bytes from alias (172.17.0.4): |
- | 64 bytes from alias (172.17.0.4): | + | 64 bytes from alias (172.17.0.4): |
64 bytes from alias (172.17.0.4): | 64 bytes from alias (172.17.0.4): | ||
^C | ^C | ||
--- alias ping statistics --- | --- alias ping statistics --- | ||
- | 4 packets transmitted, | + | 4 packets transmitted, |
- | rtt min/ | + | rtt min/ |
- | [root@6a315259b294 | + | [root@57e92a8b25d7 |
- | 127.0.0.1 localhost | + | 127.0.0.1 |
- | :: | + | ::1 |
- | fe00:: | + | fe00::0 ip6-localnet |
- | ff00:: | + | ff00::0 ip6-mcastprefix |
- | ff02:: | + | ff02::1 ip6-allnodes |
- | ff02:: | + | ff02::2 ip6-allrouters |
- | 172.17.0.4 alias | + | 172.17.0.4 |
- | 172.17.0.2 6a315259b294 | + | 172.17.0.2 |
- | [root@6a315259b294 | + | [root@57e92a8b25d7 |
exit | exit | ||
+ | root@debian11: | ||
- | root@debian9:~# docker inspect --format=' | + | root@debian11:~# docker inspect --format=' |
172.17.0.2 | 172.17.0.2 | ||
</ | </ | ||
Ligne 983: | Ligne 1083: | ||
< | < | ||
- | root@debian9:~# docker exec -it centos2 bash | + | root@debian11:~# docker exec -it centos2 bash |
- | [root@aaed3bc8e404 | + | [root@fc417b22a20d |
ping: centos3: Name or service not known | ping: centos3: Name or service not known | ||
- | [root@aaed3bc8e404 | + | [root@fc417b22a20d |
PING 172.17.0.2 (172.17.0.2) 56(84) bytes of data. | PING 172.17.0.2 (172.17.0.2) 56(84) bytes of data. | ||
- | 64 bytes from 172.17.0.2: icmp_seq=1 ttl=64 time=0.054 ms | + | 64 bytes from 172.17.0.2: icmp_seq=1 ttl=64 time=0.097 ms |
- | 64 bytes from 172.17.0.2: icmp_seq=2 ttl=64 time=0.035 ms | + | 64 bytes from 172.17.0.2: icmp_seq=2 ttl=64 time=0.082 ms |
- | 64 bytes from 172.17.0.2: icmp_seq=3 ttl=64 time=0.051 ms | + | 64 bytes from 172.17.0.2: icmp_seq=3 ttl=64 time=0.125 ms |
- | 64 bytes from 172.17.0.2: icmp_seq=4 ttl=64 time=0.071 | + | |
^C | ^C | ||
--- 172.17.0.2 ping statistics --- | --- 172.17.0.2 ping statistics --- | ||
- | 4 packets transmitted, | + | 3 packets transmitted, |
- | rtt min/ | + | rtt min/ |
- | + | ||
- | [root@aaed3bc8e404 /]# | + | |
</ | </ | ||
Ligne 1005: | Ligne 1102: | ||
< | < | ||
- | [root@aaed3bc8e404 | + | [root@fc417b22a20d |
exit | exit | ||
- | root@debian9:~# docker inspect --format=' | + | |
+ | root@debian11:~# docker inspect --format=' | ||
172.17.0.4172.25.0.3 | 172.17.0.4172.25.0.3 | ||
</ | </ | ||
Ligne 1016: | Ligne 1114: | ||
< | < | ||
- | root@debian9:~# mkdir ~/wordpress && cd ~/wordpress | + | root@debian11:~# mkdir ~/wordpress && cd ~/wordpress |
</ | </ | ||
Ligne 1022: | Ligne 1120: | ||
< | < | ||
- | root@debian9: | + | root@debian11: |
- | Unable to find image 'mariadb: | + | Unable to find image 'mysql: |
- | latest: Pulling from library/mariadb | + | latest: Pulling from library/mysql |
- | f2b6b4884fc8: Pull complete | + | e9f2695d7e5b: Pull complete |
- | 26d8bdca4f3e: Pull complete | + | 80c6055edb33: Pull complete |
- | 74f09e820cce: Pull complete | + | c646ab461d8b: Pull complete |
- | 5390f1fe4554: Pull complete | + | 012006c6a591: Pull complete |
- | 3d3f1706a741: Pull complete | + | 929d5fa34b95: Pull complete |
- | 2942f66426ea: Pull complete | + | 17e0243877fa: Pull complete |
- | 97ee11d39c75: Pull complete | + | 1850b459cd2f: Pull complete |
- | 590c46ef722b: Pull complete | + | 8dceaed53baf: Pull complete |
- | 32eb4b9666e5: Pull complete | + | 197b834ea1cd: Pull complete |
- | fc883f98a064: | + | 8df78c25b227: Pull complete |
- | bb8bee61bc1e: Pull complete | + | Digest: sha256:ceb98918916bd5261b3e9866ac8271d75d276b8a4db56f1dc190770342a77a9b |
- | Digest: sha256:6135f5b851e7fe263dcf0edf3480cdab1ab28c4287e867c5d83fbe967412ea14 | + | Status: Downloaded newer image for mysql:latest |
- | Status: Downloaded newer image for mariadb:latest | + | db3732939266ed8a112857db9c970ca39571785e62db74175bda9be5a0f9d726 |
- | 67831dacf002bdc21dc79b0e8483f538235d00ddd2e8aae175ef3ebf189ae14d | + | |
</ | </ | ||
Ligne 1044: | Ligne 1141: | ||
< | < | ||
- | root@debian9: | + | root@debian11: |
- | CONTAINER ID IMAGE | + | CONTAINER ID |
- | 67831dacf002 | + | db3732939266 |
+ | 57e92a8b25d7 | ||
+ | fc417b22a20d | ||
+ | cb2875ab1059 | ||
+ | 2126924504d8 | ||
</ | </ | ||
Ligne 1052: | Ligne 1153: | ||
< | < | ||
- | root@debian9: | + | root@debian11: |
Unable to find image ' | Unable to find image ' | ||
latest: Pulling from library/ | latest: Pulling from library/ | ||
- | 2a72cbf407d6: Pull complete | + | 1f7ce2fa46ab: |
- | 273cd543cb15: Pull complete | + | 48824c101c6a: Pull complete |
- | ec5ac8875de7: Pull complete | + | 249ff3a7bbe6: Pull complete |
- | 9106e19b56c1: Pull complete | + | aa5d47f22b64: Pull complete |
- | ee2f70ac7c7d: Pull complete | + | 851cb5d3b62c: Pull complete |
- | 7257ad6985e8: Pull complete | + | 090f07e09d3e: Pull complete |
- | 18f5c2055da2: Pull complete | + | 74f97600920f: Pull complete |
- | 85293a6fdd80: Pull complete | + | f48a9f994636: Pull complete |
- | 9e797eeb0c14: Pull complete | + | 108b4c091efa: Pull complete |
- | f16178842884: Pull complete | + | 94f753607622: Pull complete |
- | 13899c06d3f8: Pull complete | + | 5d0ec11ef45d: Pull complete |
- | 70c27fe4c3c5: Pull complete | + | 87757e6fac28: Pull complete |
- | d32c8ad2d9d7: Pull complete | + | 899a04597fc2: Pull complete |
- | 07fe445494e6: Pull complete | + | 44506e60b7c1: Pull complete |
- | 63b8de7b32fe: Pull complete | + | 305ecc1d68f5: Pull complete |
- | e4b721952e22: Pull complete | + | a4e6cb47406c: Pull complete |
- | d9ede6dd6f74: Pull complete | + | 8d4e2943ab66: Pull complete |
- | 0af4f74bfd92: Pull complete | + | cab275157cee: Pull complete |
- | e4e7c47b969f: Pull complete | + | b12b496c1035: Pull complete |
- | 69aff47f3112: Pull complete | + | 5bc81c9fd938: Pull complete |
- | Digest: sha256:201d004f55669dd2c0884f00fc44145fb0da8cafa465bf22cbaacecaf81138d4 | + | e737031fb816: Pull complete |
+ | Digest: sha256:3a2a8b925c86967a43027ec3ba146e1859de1fa0f0f535dd9b40f4d39f8b9caa | ||
Status: Downloaded newer image for wordpress: | Status: Downloaded newer image for wordpress: | ||
- | 9eb2f7fbfbd25307ed2f463c7eb3bef40bfa556174e68750bb76b8d032546129 | + | 63fec083f4d6bb6a17563d9c6b4aefce2430abea6a2172997038c8f6edabab78 |
</ | </ | ||
Ligne 1083: | Ligne 1185: | ||
< | < | ||
- | root@debian9: | + | root@debian11: |
- | CONTAINER ID IMAGE | + | CONTAINER ID |
- | 9eb2f7fbfbd2 | + | 63fec083f4d6 |
- | 67831dacf002 | + | db3732939266 |
+ | 57e92a8b25d7 | ||
+ | fc417b22a20d | ||
+ | cb2875ab1059 | ||
+ | 2126924504d8 | ||
</ | </ | ||
Ligne 1092: | Ligne 1198: | ||
< | < | ||
- | root@debian9: | + | root@debian11: |
- | [1]WordPress | + | |
- | | + | |
| | ||
+ | root@debian11: | ||
- | References | + | root@debian11: |
- | + | /root | |
- | 1. https:// | + | root@debian11:~# |
- | + | ||
- | root@debian9: | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | | + | |
- | root@debian9:~/wordpress# lynx --dump http:// | + | |
- | | + | |
- | | + | |
- | + | ||
- | | + | |
- | + | ||
- | References | + | |
- | + | ||
- | 1. https:// | + | |
</ | </ | ||
Ligne 1137: | Ligne 1229: | ||
< | < | ||
- | docker run -d --name=redis redis | + | root@debian11: |
- | docker run -d --name=db -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres postgres: | + | Unable to find image ' |
- | docker run -d --name=vote -p 5000:80 --link redis:redis dockersamples/ | + | latest: Pulling from library/ |
- | docker run -d --name=result -p 5001:80 --link db:db dockersamples/ | + | 1f7ce2fa46ab: |
- | docker run -d --name=worker --link db:db --link redis:redis dockersamples/ | + | 4827e9d1e197: |
+ | 5845062cfda9: | ||
+ | 44d659adcf8b: | ||
+ | b6962d83313d: | ||
+ | 5d29cf86ecab: | ||
+ | 4f4fb700ef54: | ||
+ | 3a2d9f90268c: | ||
+ | Digest: sha256: | ||
+ | Status: Downloaded newer image for redis: | ||
+ | 227554e3e4c198272cbf21dd468e7cf78d4a75ad5ed000a9df364aa98726bc86 | ||
+ | |||
+ | root@debian11: | ||
+ | Unable to find image ' | ||
+ | 9.4: Pulling from library/ | ||
+ | 619014d83c02: | ||
+ | 7ec0fe6664f6: | ||
+ | 9ca7ba8f7764: | ||
+ | 9e1155d037e2: | ||
+ | febcfb7f8870: | ||
+ | 8c78c79412b5: | ||
+ | 5a35744405c5: | ||
+ | 27717922e067: | ||
+ | 36f0c5255550: | ||
+ | dbf0a396f422: | ||
+ | ec4c06ea33e5: | ||
+ | e8dd33eba6d1: | ||
+ | 51c81b3b2c20: | ||
+ | 2a03dd76f5d7: | ||
+ | Digest: sha256: | ||
+ | Status: Downloaded newer image for postgres: | ||
+ | 5083545dcbf88ed9d1e605d306fe8dba86df1c130fcc843e7fba30eadd524545 | ||
+ | |||
+ | root@debian11: | ||
+ | Unable to find image ' | ||
+ | latest: Pulling from dockersamples/ | ||
+ | a378f10b3218: | ||
+ | c11bdfacfd25: | ||
+ | 64fc9a66a5d8: | ||
+ | 5146634606ba: | ||
+ | 479ce1f6823a: | ||
+ | 070425b38bdc: | ||
+ | ce42fc94cbff: | ||
+ | 6bad37ec452b: | ||
+ | edf50a17349a: | ||
+ | db9bdfb7847f: | ||
+ | Digest: sha256: | ||
+ | Status: Downloaded newer image for dockersamples/ | ||
+ | 81e6fcb9f6920c048b3062e3da8e7e48b0475e5de3059ff3e5e63cbf73cb5fe6 | ||
+ | |||
+ | root@debian11: | ||
+ | Unable to find image ' | ||
+ | latest: Pulling from dockersamples/ | ||
+ | a378f10b3218: | ||
+ | bc194d4002b7: | ||
+ | 231a505b2fbc: | ||
+ | 71731700a241: | ||
+ | 9c2ee871f3d2: | ||
+ | a5ec303d8450: | ||
+ | 0548d3f3cdbd: | ||
+ | c33ac9356c9f: | ||
+ | 495a50ede288: | ||
+ | 66140bd7f458: | ||
+ | 4d77129208cd: | ||
+ | Digest: sha256: | ||
+ | Status: Downloaded newer image for dockersamples/ | ||
+ | 33a264a36bdc63ba7c0a4e3412e437d20357b1142a02e26b6f6ccfb4aaab6cf2 | ||
+ | |||
+ | root@debian11: | ||
+ | Unable to find image ' | ||
+ | latest: Pulling from dockersamples/ | ||
+ | e67fdae35593: | ||
+ | 0ab66724116f: | ||
+ | 14ccddebb1bc: | ||
+ | 5e265b51b431: | ||
+ | 9ac34f7bda15: | ||
+ | 17081859cc14: | ||
+ | Digest: sha256: | ||
+ | Status: Downloaded newer image for dockersamples/ | ||
+ | cf27f30654d2c527f30c1ed4b80a517ab589dc1579c30af7bd4e53eba746354a | ||
+ | |||
+ | root@debian11: | ||
+ | CONTAINER ID | ||
+ | cf27f30654d2 | ||
+ | 33a264a36bdc | ||
+ | 81e6fcb9f692 | ||
+ | 5083545dcbf8 | ||
+ | 227554e3e4c1 | ||
+ | 63fec083f4d6 | ||
+ | db3732939266 | ||
+ | 57e92a8b25d7 | ||
+ | fc417b22a20d | ||
+ | cb2875ab1059 | ||
+ | 2126924504d8 | ||
</ | </ | ||
Cette solution utilise un réseau de type Bridge. Ce type de réseau est limité aux conteneurs d'un hôte unique exécutant Docker. Les conteneurs ne peuvent communiquer qu' | Cette solution utilise un réseau de type Bridge. Ce type de réseau est limité aux conteneurs d'un hôte unique exécutant Docker. Les conteneurs ne peuvent communiquer qu' | ||
- | |||
=====LAB #3 - Superviser les Conteneurs===== | =====LAB #3 - Superviser les Conteneurs===== | ||
Ligne 1154: | Ligne 1337: | ||
< | < | ||
- | root@debian9:~# docker logs mongo2 | + | root@debian11:~# docker logs mongo2 |
- | root@332aa9930f30:/# ip addr | + | root@5bfbf0306ad7:/# ip a |
bash: ip: command not found | bash: ip: command not found | ||
- | root@332aa9930f30:/# ip address | + | root@5bfbf0306ad7:/# ip addr |
bash: ip: command not found | bash: ip: command not found | ||
- | root@332aa9930f30:/# | + | root@5bfbf0306ad7:/# exit |
- | bash: ifconfig: command not found | + | |
- | root@332aa9930f30:/# | + | |
- | bin boot core data dev docker-entrypoint-initdb.d entrypoint.sh | + | |
- | root@332aa9930f30:/# | + | |
- | root@332aa9930f30:/# | + | |
- | root@332aa9930f30:/# | + | |
- | bash: docker: command not found | + | |
- | root@332aa9930f30:/# exit | + | |
exit | exit | ||
</ | </ | ||
Ligne 1176: | Ligne 1351: | ||
< | < | ||
- | root@debian9:~# docker top centos3 | + | root@debian11:~# docker top centos3 |
UID | UID | ||
- | root | + | root |
</ | </ | ||
Ligne 1186: | Ligne 1361: | ||
< | < | ||
- | root@debian9:~# docker stats centos3 | + | root@debian11:~# docker stats centos3 |
- | CONTAINER | + | CONTAINER |
- | centos3 | + | 57e92a8b25d7 |
+ | ^C | ||
+ | root@debian11: | ||
</ | </ | ||
----- | ----- | ||
- | < | + | |
- | <div align=" | + | Copyright © 2024 Hugh Norris. |
- | Copyright © 2021 Hugh NORRIS | + | |
- | </ | + | |
- | </ | + |