Upload
vocong
View
224
Download
1
Embed Size (px)
Citation preview
Introduction aux conteneurs
Stanislas Quastana & Pascal Sauliere
Architectes Infrastructure, CISSP
Microsoft DX
Qu’est ce qu’un conteneur ?
Virtualisation d’OS
Perception d’environnement isolé et indépendant
Package déclaratif
Unité de déploiement « universelle »
Idéal pour le développement et les tests
Un peu d’histoire sur les conteneurs
Conteneur = unité de transport intermodal
Virtualisation de processus UNIX chroot (1979-1982)
BSD Jail (1998)
Parallels Virtuozzo (2001)
Solaris Containers (2005)
Linux LXC (2008)
Docker (2013)
Server
Host OS
Hypervisor
Server
Host OS
Docker Engine
Guest
OS
Guest
OS
Guest
OS
Bins/Libs Bins/Libs Bins/Libs
App A App A’ App B
Bins/Libs Bins/Libs
Ap
p A
Ap
p A
’
Ap
p B
Ap
p B
’
Ap
p B
Ap
p B
’
Ap
p B
Ap
p B
’Machines virtuelles
versus conteneurs
Guest
OS
Bins/Libs
App B’
Docker
Solution pour manipuler des conteneurs LXC
Modèle avec architecture de type client / serveur Client Docker
Moteur Docker
Communication client / serveur avec des appels en REST
Ensemble de commandes (une quarantaine) Décrire l’image d’une application à déployer dans un conteneur
Publier l’image dans un repository (public ou privé)
Interroger un repository
Gérer les versions des images dans un repository (appelé Registry)
Déployer des images…
Client et moteur Docker
Client Docker (ligne de commande) disponible sur Mac, Linux et Windows docker run pour instancier un nouveau conteneur
docker pull pour récupérer une image
docker build pour construire une nouvelle image
Moteur Docker (Docker Host) disponible uniquement sur une distribution Linux (CoreOS, Ubuntu, RedHat…) La machine Linux peut être une machine virtuelle sur Azure, Hyper-V…
Images Docker
Chaque image commence par une image de base (ex: Ubuntu) ou plus « avancée » comme Node.js installé sur Ubuntu
Chaque image est ensuite constituée d'une série de couches baptisées « layers »
Dockerfile
L’ensemble des commandes pour construire une image, le tout rassemblé et stocké dans un fichier
Docker Hub : le référentiel public
Il offre La « Registry » : système de stockage pour les images de conteneurs
Le « public index » : référencement des images publiques avec système d’évaluation / classement
« automated builds » pour lier un dépôt de code GitHub ou Bitbucket et créer automatiquement des images Docker à chaque commit
Docker en résumé
Docker Engine
Docker Client
Docker Registry(Trusted Docker Registry & Docker Hub)
Docker Compose
Docker Swarm
Partenariat Microsoft - Docker
Extension des API et outils Docker pour supporter les conteneurs Windows
Client Docker CLI sur Windows Prochainement client Docker unique pour gérer les conteneurs Linux et Windows
Extension Docker pour les VM Linux sur Azure
Support de Docker Compose et Docker Swarm sur Azure
Outils Visual Studio pour Docker https://visualstudiogallery.msdn.microsoft.com/0f5b2caa-ea00-41c8-b8a2-058c7da0b3e4
Conteneurs Docker dans le Marketplace Azure
Technologies d’isolation dans WindowsW
ind
ow
s
ProcessJob
Object
Windows
Server
Container
Hyper-V
Container
Hyper-V
Virtual
Machine
Plus rapide et plus efficace Plus isolé
Kernel
Conteneur Windows Server
Environnement d’exécution isolé des applications de la machine hôtes
Mode utilisateur
Mode Kernel
Système hôte
Container
Management
stack
Docker PS
WMI
Mode utilisateur
Mode Kernel
Hyperviseur (Hyper-V)
Kernel Kernel
Conteneur Hyper-V
Environnement d’exécution isolé pour des applications profitant d’une isolation additionnelle apporté par Hyper-V
partition(s) Hyper-V
Container
Management
stack
Docker PS
WMI
Système hôte
Kernel
Ecosystème conteneur
Container Run-Time
Linux
Image Repository
Application A
Application
Framework A
Application
Framework B
Application B
Container Images
Application A
Application
Framework B
Application B
Container Images
PS>Get-ContainerImage
Name Publisher Version IsOSImage
------ ---------- -------- ------------
Windows CN=Microsoft 10.0.10250.0 True
Image Repository
Container: Node -OFF
Container Images
Container image: Node Image Repository
PS> New-Container -Name ‘Node' -ContainerImageName 'Windows‘
Container: Node
Container Images
C:\Windows
Container image: Node Image Repository
PS> New-Container -Name ‘Node' -ContainerImageName 'Windows‘
PS> Start-Container ‘Node’
Container: Node
Container Images
C:\Windows
C:\Node
Container image: Node Image Repository
PS> New-Container -Name ‘Node' -ContainerImageName 'Windows‘
PS> Start-Container ‘Node’
Inside the container…
[abc-123] PS> cmd /c node.msi
Container: Node -OFF
Container Images
C:\Windows
C:\Node
Container image: Node Image Repository
PS> New-Container -Name ‘Node' -ContainerImageName 'Windows‘
PS> Start-Container ‘Node’
Inside the container…
[abc-123] PS> cmd /c node.msi
Outside the container…
PS> Stop-Container ‘Node’
Container: Node -OFF
Container Images
C:\Windows
C:\Node
Container image: Node
TRNode
Image Repository
PS> New-Container -Name ‘Node' -ContainerImageName 'Windows‘
PS> Start-Container ‘Node’
Inside the container…
[abc-123] PS> cmd /c node.msi
Outside the container…
PS> Stop-Container ‘Node’
PS> New-ContainerImage –ContainerName ‘Node’ –Name ‘TRNode’
Container: Web -OFF
Container Images
Container image: Web
TRNode
Image Repository
PS> New-Container -Name ‘Node' -ContainerImageName 'Windows‘
PS> Start-Container ‘Node’
Inside the container…
[abc-123] PS> cmd /c node.msi
Outside the container…
PS> Stop-Container ‘Node’
PS> New-ContainerImage –ContainerName ‘Node’ –Name ‘TRNode’
PS> New-Container -Name ‘Web' –ContainerImageName ’TRNode‘
Container: Web
Container Images
C:\Windows
C:\Node
TRNode
Container image: Web
PS> New-Container -Name ‘Node' -ContainerImageName 'Windows‘
PS> Start-Container ‘Node’
Inside the container…
[abc-123] PS> cmd /c node.msi
Outside the container…
PS> Stop-Container ‘Node’
PS> New-ContainerImage –ContainerName ‘Node’ –Name ‘TRNode’
PS> New-Container -Name ‘Web' –ContainerImageName ’TRNode‘
PS> Start-Container ‘Web’
TRNode
Image Repository
Dépôt d’images
Central Image Repository
Application A
Application
Framework A
Application
Framework B
Application B
Application C Application D
Container
Host 2
Container
Host 1
Container
Host 3
Processus de développement & conteneurs
CentralRepository
Local Repository
Application
Framework A
Les développeurs peuvent choisirles frameworks
applicatifs qu’ils désirent et les récupérer en local depuis un
dépôt central
Application
Framework A
Processus de développement & conteneurs
CentralRepository
Local Repository
Application
Framework A
Les développeurs peuvent choisir les frameworks
applicatifs qu’ils désirent et les récupéreren local depuis un dépôt central
Application
Framework A
Processus de développement & conteneurs
CentralRepository
Local Repository
Application
Framework A
Application
Framework A
using System;class Program{
static void Main(){
}}
Processus de développement & conteneurs
CentralRepository
Local Repository
Application
Framework A
Application
Framework A
using System;class Program{
static void Main(){
}}
Processus de développement & conteneurs
CentralRepository
Local Repository
Application
Framework A
Application
Framework A
using System;class Program{
static void Main(){
}}
Processus de développement & conteneurs
CentralRepository
Local Repository
Application
Framework A
Application
Framework A
using System;class Program{
static void Main(){
}}
Conteneur Windows Server ou conteneurHyper-V ? Windows Server Container Multi-location de confiance
Hautement automatisable
Montée en charger / élasticité
Faible empreinte
Hyper-V Containers Multi-location
Workload avec contraintes réglementaires
Windows Container OS
Windows Server Core Hautement compatible
Applications existantes fonctionnant sur Windows Server configuré en mode Core
Nano Server Optimisé pour la haute densité de
conteneurs
Applications “Born in the cloud” ;-)
Applications distribuées
4
0
30
0
Administration des Windows containers
PowerShell Gestion native
Local
Hautement automatisable
Similaire à des cmlets pour gérer des VM
Docker Téléchargement séparé
Local
Dépôt central
Pour les personnes habituées à Docker
Retrouvez nous sur la Microsoft Virtual Academyhttp://aka.ms/mvafr
Stanislas Quastana
http://aka.ms/Stanislas
Twitter : @squastana
Pascal Sauliere
http://aka.ms/pascals
Twitter : @psauliere
© 2015 Microsoft Corporation. All rights reserved. Microsoft, Windows, Microsoft Azure and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other
countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond
to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date
of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION
Lectures complémentaires
Containers: Docker, Windows and Trends http://azure.microsoft.com/blog/2015/08/17/containers-docker-windows-and-trends/
How to use docker-machine with Azure https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-docker-machine/