Installation Docker dans Ubuntu 20.04
Le tutoriel suivant décrit comment installer et docker docker-Compose Ubuntu 20.04.
Fabriqué avec seulement quelques étapes.
Pour commencer, nous allons installer Docker le fera avec la commande:
1 | sudo apt install docker.io |
Ensuite, ajoutez le service au système:
1 | sudo systemctl enable --now docker |
La commande sudo sans docker
Docker gestion par défaut nécessite des privilèges d'administrateur.
Pour exécuter la commande docker en tant qu'utilisateur autre que root sudo sans préparation, vous devez ajouter un utilisateur à un groupe.
1 | sudo usermod -aG docker nasz_użytkownik |
Docker, nous vérifions la version en tapant:
1 | docker --version |
Nous courons le récipient de test peut être effectué en utilisant la commande:
1 | docker run hello-world |
Un tout devrait fonctionner correctement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/ |
Installation docker-Compose
Nous faisons la commande d'installation:
1 | apt install docker-compose |
Nous vérifions la commande version:
1 | docker-compose version |
1 2 3 4 | docker-compose version 1.21.0, build unknown docker-py version: 3.4.1 CPython version: 3.7.5 OpenSSL version: OpenSSL 1.1.1c 28 May 2019 |