issue140:tutoriel1
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue140:tutoriel1 [2019/01/01 14:57] – d52fr | issue140:tutoriel1 [2019/01/07 11:15] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
**In my line of work I don't really get any exposure to containers, but the landscape is changing and if you want to stay relevant, you need to know. At first it was a scary prospect, until Daniel from the Full Circle Telegram group gave me a quick introduction to Vagrant. I had seen LXC on the internet, but assumed (incorrectly) that it was just another virtual machine manager. When I wanted to look into LXC, I was told about LXD, which is LXC with bells on. ** | **In my line of work I don't really get any exposure to containers, but the landscape is changing and if you want to stay relevant, you need to know. At first it was a scary prospect, until Daniel from the Full Circle Telegram group gave me a quick introduction to Vagrant. I had seen LXC on the internet, but assumed (incorrectly) that it was just another virtual machine manager. When I wanted to look into LXC, I was told about LXD, which is LXC with bells on. ** | ||
- | Dans mon travail, je ne suis pas vraiment tourné vers les conteneurs, mais le paysage change et si vous voulez rester pertinent, vous devez les connaître. | + | Dans mon travail, je ne suis pas vraiment tourné vers les conteneurs, mais le paysage change et si vous voulez rester pertinent, vous devez les connaître. |
**What is LXD? | **What is LXD? | ||
Ligne 18: | Ligne 18: | ||
We can try LXD out online without installing anything at: https:// | We can try LXD out online without installing anything at: https:// | ||
+ | |||
+ | Et c'est quoi ? | ||
+ | |||
+ | Les conteneurs sont une technologie de virtualisation allégée qui n' | ||
+ | |||
+ | Faisons un petit tour rapide ensemble. | ||
+ | |||
+ | Nous pouvons tester LXD en ligne, sans rien installer, à : https:// | ||
**For those who want to try it at home, the LXD container hypervisors are supported and created by Ubuntu team, so installation is as simple as: | **For those who want to try it at home, the LXD container hypervisors are supported and created by Ubuntu team, so installation is as simple as: | ||
Ligne 27: | Ligne 35: | ||
2. Create our first container | 2. Create our first container | ||
3. Launch a container** | 3. Launch a container** | ||
+ | |||
+ | Pour ceux qui veulent l' | ||
+ | |||
+ | sudo apt install lxd | ||
+ | |||
+ | En résumé : | ||
+ | 1. Paramétrer et configurer LXD | ||
+ | 2. Créer notre premier conteneur | ||
+ | 3. Lancer un conteneur | ||
**Once LXD is installed, there will be a LXD group added to your list of groups. Just add your user to the group to be able to manage containers: | **Once LXD is installed, there will be a LXD group added to your list of groups. Just add your user to the group to be able to manage containers: | ||
Ligne 33: | Ligne 50: | ||
Should the group not be created, add it yourself: | Should the group not be created, add it yourself: | ||
+ | |||
+ | newgrp lxd** | ||
+ | |||
+ | Une fois LXD installé, vous trouverez un groupe LXD ajouté à votre liste de groupes. Il suffit d' | ||
+ | |||
+ | sudo adduser gewgaw lxd | ||
+ | |||
+ | Au cas où le groupe n' | ||
newgrp lxd | newgrp lxd | ||
+ | |||
- | Setup** | + | **Setup |
- | + | ||
- | **Instead of configuring LXD by hand, it comes with a handy set up: | + | Instead of configuring LXD by hand, it comes with a handy set up: |
sudo lxd init | sudo lxd init | ||
Ligne 44: | Ligne 70: | ||
LXD is built on top of LXC so the lxc commands are all valid.** | LXD is built on top of LXC so the lxc commands are all valid.** | ||
+ | |||
+ | Paramétrage | ||
+ | |||
+ | Au lieu de configurer LXD à la main, il arrive avec un paramétrage pratique : | ||
+ | sudo lxd init | ||
+ | |||
+ | Vous devrez répondre aux questions à l' | ||
+ | |||
+ | LXD est construit par dessus LXC ; aussi toutes les commandes lxc sont valables. | ||
**Creation | **Creation | ||
Ligne 56: | Ligne 91: | ||
lxc launch images: | lxc launch images: | ||
+ | |||
+ | Création | ||
+ | |||
+ | Pour créer et démarrer des conteneurs à partir d' | ||
+ | |||
+ | exemples : | ||
+ | |||
+ | xc launch images: | ||
+ | |||
+ | ou: | ||
+ | |||
+ | lxc launch images: | ||
+ | |||
**Can you see the pattern? | **Can you see the pattern? | ||
Ligne 67: | Ligne 115: | ||
You can get a lot more info here: https:// | You can get a lot more info here: https:// | ||
+ | |||
+ | Pouvez-vous voir le motif ? | ||
+ | |||
+ | Notre conteneur est maintenant créé. Pour confirmer sa création, nous pouvons utiliser la commande : lxc list | ||
+ | |||
+ | Ceci vous donnera le nom de votre conteneur, son état, l' | ||
+ | |||
+ | exemples : | ||
+ | |||
+ | lxc start, lxc stop, lxc info, lxc delete, lxc destroy, lxc create, lxc clone, etc. | ||
+ | |||
+ | Vous pouvez trouver beaucoup plus d' | ||
**LXD is typically added to the Linux kernel. Packaged LXD distributions are available for numerous Linux distributions, | **LXD is typically added to the Linux kernel. Packaged LXD distributions are available for numerous Linux distributions, | ||
+ | |||
+ | LXD est contenu classiquement dans le noyau Linux. Des distributions packagées de LXD sont disponibles pour de nombreuses distributions Linux, y compris Fedora, Debian, openSUSE, Ubuntu, Alpine Linux, Arch Linux et Gentoo. Vous pouvez aussi obtenir des compilations de LXD pour Windows et OSX. | ||
**Launch | **Launch | ||
Ligne 81: | Ligne 143: | ||
To run a script you need to provide the full path to that script.** | To run a script you need to provide the full path to that script.** | ||
+ | |||
+ | Lancement | ||
+ | |||
+ | Quand vous lancerez « lxc list », vous trouverez un nom dans la première colonne. Pour démarrer un conteneur, tapez simplement : « lxc exec » suivi du nom de la première colonne. Par exemple : | ||
+ | |||
+ | lxc exec centos-c2 | ||
+ | |||
+ | L' | ||
+ | |||
+ | lxc exec fedora28-c7 -- dnf update | ||
+ | |||
+ | Pour lancer un script, vous devez fournir le chemin complet vers ce script. | ||
**To work inside a container, add '-- bash' to the end: | **To work inside a container, add '-- bash' to the end: | ||
Ligne 87: | Ligne 161: | ||
When you are done doing updates or installing software, simply type: exit** | When you are done doing updates or installing software, simply type: exit** | ||
+ | |||
+ | Pour travailler dans un conteneur, ajoutez « -- bash » à la fin : | ||
+ | |||
+ | lxc exec fedora28-c7 -- bash | ||
+ | |||
+ | Quand les mises à jour ou des installations de logiciels sont terminées, tapez simplement : exit | ||
**That is the quick overview on LXD. There is more to it, but you will pick up everything else very fast once you have this bit under your belt. | **That is the quick overview on LXD. There is more to it, but you will pick up everything else very fast once you have this bit under your belt. | ||
Ligne 94: | Ligne 174: | ||
Website: https:// | Website: https:// | ||
+ | |||
+ | C'est un aperçu rapide de LXD. Plus de choses existent à son sujet, mais vous récupérerez facilement le reste une fois que vous aurez digérez ce début. | ||
+ | |||
+ | Voici où vous trouverez une liste de commandes : https:// | ||
+ | |||
+ | |||
+ | Site Web : https:// |
issue140/tutoriel1.1546351062.txt.gz · Dernière modification : 2019/01/01 14:57 de d52fr