Outils pour utilisateurs

Outils du site


docker

Ceci est une ancienne révision du document !


Table des matières

DOCKER

Installation

page install Debian

docker in lxc

Formation Docker


Mise à jour des sources list:

#apt update

Instal des pré-requis:

#apt install ca-certificates curl gnupg lsb-release

Download de la clé de signature:

#curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Création du dossier key:

#mkdir -p /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/debian/gpg | gpg –dearmor -o /etc/apt/keyrings/docker.gpg

2dition de la source list:

#echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Installation de docker et dépendance:

#apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Pour tester si install ok:

#docker run hello-world

Réponse si ok:

#Hello from Docker!
This message shows that your installation appears to be working correctly.

Receiving a GPG error when running apt-get update?

Your default umask may not be set correctly, causing the public key file for the repo to not be detected. Run the following command and then try to update your repo again:

#chmod a+r /etc/apt/keyrings/docker.gpg

COMMANDE DOCKER

Pour obtenir un shell root dans un container docker exec -it -u root name_of_container bash ou /bin/bash
Pour obtenir la commande IP ADD apt install iproute2
Pour lister les containers inactifs/actifs docker ps / docker ps -a
Pour supprimer un container docker rm name_of_container
Pour lancer container avec fichier .yml docker compose up -d
Vérifier si docker fonctionne docker run hello-word
démarrer container en mode détaché docker run -d hello-word
démarrer container avec portforwarding hôte/container docker run -p6000:6800 nginx
Vérifier les réseaux docker docker network ls
Vérifier status service docker systemctl status docker
Vérifier version docker docker version
info docker docker system info
Vérifier stockage docker docker system df
Chercher une image sur dockerhub docker search debian
Télécharger une image sur dockerhub docker image pull
Lister les images sur l'hôte docker image ls
stopper ou demarrer un container docker stop ou start ID_container
vérifier logs container container docker logs ID_container
docker.1726058963.txt.gz · Dernière modification : 2024/09/11 14:49 de huracan

DokuWiki Appliance - Powered by TurnKey Linux