Skip to main content

Installer docker & docker-compose

Etape 1 : Les dépendances
apt install apt-transport-https ca-certificates gnupg2 software-properties-common
Etape 2 : Ajouter docker dans le repository
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-keysudo addgpg --dearmor add-apt-repository-o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64]amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
Etape 3 : Mise à jour des paquets 
apt update
Etape 4 : Installer Docker
apt install docker-ce
Etape 5 : Test
systemctl status docker
root@vm-web:~# systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; preset: enabled)
     Active: active (running) since Sun 2023-12-10 19:27:20 CET; 33s ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 8610 (dockerd)
      Tasks: 9
     Memory: 29.8M
        CPU: 394ms
     CGroup: /system.slice/docker.service
             └─8610 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

déc. 10 19:27:20 vm-web systemd[1]: Starting docker.service - Docker Application Container Engine...
déc. 10 19:27:20 vm-web dockerd[8610]: time="2023-12-10T19:27:20.284944139+01:00" level=info msg="Starting up"
déc. 10 19:27:20 vm-web dockerd[8610]: time="2023-12-10T19:27:20.430101570+01:00" level=info msg="Loading containers: start."
déc. 10 19:27:20 vm-web dockerd[8610]: time="2023-12-10T19:27:20.769213106+01:00" level=info msg="Loading containers: done."
déc. 10 19:27:20 vm-web dockerd[8610]: time="2023-12-10T19:27:20.789324414+01:00" level=info msg="Docker daemon" commit=311b9ff graphdriver=overlay2 version=24.0.7
déc. 10 19:27:20 vm-web dockerd[8610]: time="2023-12-10T19:27:20.789479443+01:00" level=info msg="Daemon has completed initialization"
déc. 10 19:27:20 vm-web dockerd[8610]: time="2023-12-10T19:27:20.830725349+01:00" level=info msg="API listen on /run/docker.sock"
déc. 10 19:27:20 vm-web systemd[1]: Started docker.service - Docker Application Container Engine.
Etape 6 : Installer docker-compose
apt-get install docker-compose