Installation de Docker en ligne de commande
TheLe paquet d'installation de Docker installationdisponible packagedans availablele indépôt theofficiel officialde Debian repositorypeut mayne notpas beêtre thela latestdernière version. ToPour ensures'assurer wed'obtenir getla the latestdernière version, we’llnous installallons installer Docker fromà thepartir officialdu dépôt officiel de Docker. Pour cela, nous allons ajouter une nouvelle source de paquet, ajouter la clé GPG de Docker repository.pour Tos'assurer doque that,les we’lltéléchargements addsont avalides, newpuis packageinstaller source,le add the GPG key from Docker to ensure the downloads are valid, and then install the package.paquet.
InstallInstaller aquelques fewpaquets prerequisiteprérequis packagesqui whichpermettent letà apt used'utiliser packagesdes overpaquets HTTPS:sur HTTPS :
sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common
Then add theclé GPG keydu fordépôt theofficiel officialde Docker repositoryà tovotre yoursystème system::
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
AddAjouter thele dépôt Docker repositoryaux tosources APT sources::
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
Next,Ensuite, updatemettez theà packagejour databasela withbase thede données de paquets avec les paquets Docker packagesdu fromnouveau therepo newly added repo::
sudo apt update
Make sure you are about to install from the Docker repo instead of the default Debian repo:
apt-cache policy docker-ce
You’ll see output like this, although the version number for Docker may be different:
docker-ce:
Installed: (none)
Candidate: 5:20.10.12~3-0~debian-buster
Version table:
5:20.10.12~3-0~debian-buster 500
500 https://download.docker.com/linux/debian buster/stable amd64 Packages
Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Debian 10 (buster).
Finally, install Docker:
sudo apt install docker-ce
Docker is now installed, the daemon started, and the process enabled to start on boot. Check that it’s running:
sudo systemctl status docker
The output will be similar to the following, showing that the service is active and running:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-07-08 15:11:19 UTC; 58s ago
Docs: https://docs.docker.com
Main PID: 5709 (dockerd)
Tasks: 8
Memory: 31.6M
CGroup: /system.slice/docker.service
└─5709 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Installing Docker gives you not just the Docker service (daemon) but also the docker command line utility, or the Docker client. We’ll explore how to use the docker command later in this tutorial.