Skip to content

Installation Docker

Centos

Nous allons installer Docker sur le host de type CentOS 7

Installation avec le package manager

Mettre à jour CentOS

Terminal window
sudo dnf update -y

Ensuite installer les utilitaires yum

Terminal window
sudo dnf -y install dnf-plugins-core

Ajouter le dépôt docker

Terminal window
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Installer Docker CE

Terminal window
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Démarrer et activer le service Docker

Terminal window
sudo systemctl enable --now docker

Ajouter l’utilisateur sadmin dans le groupe docker

Terminal window
sudo usermod -aG docker sadmin

Vérifier l’installation: exécuter un premier conteneur basé sur l’image hello-world

Terminal window
newgrp docker
docker run hello-world
Terminal window
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7 Status: Downloaded newer image for hello-world:latest
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.