From 2749af885ba4fd4ad4078a125c4d351f6c56dc62 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Sun, 28 Jul 2024 13:47:03 +0200 Subject: [PATCH] Update presentation --- presentation/assets/Compose.drawio.svg | 2 +- presentation/assets/chroot.svg | 3 + presentation/assets/image.svg | 3 + presentation/slides.md | 103 ++++++++++++++++--------- 4 files changed, 72 insertions(+), 39 deletions(-) create mode 100644 presentation/assets/chroot.svg create mode 100644 presentation/assets/image.svg diff --git a/presentation/assets/Compose.drawio.svg b/presentation/assets/Compose.drawio.svg index 8579409..c28cf0c 100644 --- a/presentation/assets/Compose.drawio.svg +++ b/presentation/assets/Compose.drawio.svg @@ -1,4 +1,4 @@ -
Host
Host
Docker network : front
Docker network : front
Docker network : back
Docker network : back
Database
Database
Backend
Backend
Frontend
Frontend
Reverse Proxy
Reverse Proxy
80
80
8080
8080
6379
6379
80
80
Client
Client
Client
Client
Exposed port : 80
Exposed port : 80
80
80
\ No newline at end of file +
Host
Host
Docker network : front
Docker network : front
Docker network : back
Docker network : back
Database
Database
Backend
Backend
Frontend
Frontend
3000
3000
6379
6379
80
80
Client
Client
Client
Client
Exposed port : 80
Exposed port : 80
80
80
Text is not SVG - cannot display
\ No newline at end of file diff --git a/presentation/assets/chroot.svg b/presentation/assets/chroot.svg new file mode 100644 index 0000000..0f40737 --- /dev/null +++ b/presentation/assets/chroot.svg @@ -0,0 +1,3 @@ + + +
/
usr
bin
bin
lib
libreoffice
libjson
ls
cp
opt
chroot-example
usr
bin
bin
lib
httpd
openssl
ls
cp
/
\ No newline at end of file diff --git a/presentation/assets/image.svg b/presentation/assets/image.svg new file mode 100644 index 0000000..c723408 --- /dev/null +++ b/presentation/assets/image.svg @@ -0,0 +1,3 @@ + + +
image
tag : repository/organization/projet:version
usr
bin
bin
lib
httpd
openssl
ls
cp
/
\ No newline at end of file diff --git a/presentation/slides.md b/presentation/slides.md index dfe714a..56dd780 100644 --- a/presentation/slides.md +++ b/presentation/slides.md @@ -1,3 +1,8 @@ +## Simplifiez vos déploiement avec la conteneurisation +Nathan Tien You + +--- + ## Sommaire - Introduction à la conteneurisation - Docker @@ -30,6 +35,22 @@ --- +## Infrastructure as code +- Automatisation + - Fiabilité + - Efficacité +- Contrôle des versions +- Autodocumenté +- Immutabilité + +--- + +## Virtualisation du service +![Comparison between containers, bare metal, and virtual machines](https://about.gitlab.com/images/blogimages/containers-vm-bare-metal.png "Containers vs VMs")\ +source : [Gitlab](https://gitlab.com) + +--- + ## Différents types de conteneurisation - Conteneurs Processus - Docker @@ -40,48 +61,38 @@ --- -## Virtualisation du service -![Comparison between containers, bare metal, and virtual machines](https://about.gitlab.com/images/blogimages/containers-vm-bare-metal.png "Containers vs VMs")\ -source : [Gitlab](https://gitlab.com) - ---- - -## Infrastructure as code -- Automatisation - - Fiabilité - - Efficacité -- Contrôle des versions -- Code = Infrastructre : autodocumenté -- Immutabilité - ---- - ## Conteneurs - - - +Contexte d'éxecution isolé : chroot ----- + -```bash [1-5|1-2|3|4|5] +--- + +## Base du conteneur : image + + + +- Point d'entrée (exécutable) +- Variables d'environnement +- Ports + +--- + +## Registres d'images +![Docker image registry](https://despliegue.codeandcoke.com/_media/apuntes:arquitectura_docker.png) +--- + +## Lancement d'un conteneur + +```bash docker run \ -it --rm \ -v /tmp:/usr/local/apache2/htdocs/ \ -p 8000:80 \ httpd:latest ``` - - ----- - -![OverlayFS](https://docs.docker.com/storage/storagedriver/images/overlay_constructs.webp) - - + ---- @@ -89,11 +100,27 @@ httpd:latest --- -## Images -```Docker -FROM httpd:alpine +## Bonnes pratiques Docker +- Conteneurs éphémères + - Processus stateless + - Architecture Shared-nothing +- Images minimales + - Installer uniquement le nécessaire + - Séparer compilation et mise en production -COPY files/* /usr/local/apache2/htdocs/ +--- + +## Construction d'une image +```Docker dockercompose +FROM node:lts-alpine3.20 +WORKDIR /app + +COPY package.json ./ +COPY package-lock.json ./ +COPY index.js ./ +RUN npm ci + +CMD ["node", "index.js"] ``` ![Container Insides](./assets/Image.drawio.svg) ```bash @@ -121,7 +148,7 @@ docker buildx build . -t demo:latest ---- -```yaml [|1-4,11-13,22-23|5-6,14-15,36-37|8-9,18-19,28-30,32-34|7,16-17,24-25,26-27] dockercompose +```yaml [|1-4,11-13,21-23|5-6,14-15,36-37|8-9,18-19,28-30,32-34|7,16-17,24-25,26-27] dockercompose services: database: @@ -167,7 +194,7 @@ volumes: - Clusters - Stockage distribué - Haute Disponibilité - - Redonance + - Redondance - Stratégie de déploiement ---