DOCKER MACHINE

 


 



    

    



Install using the apt repository

Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker apt repository. Afterward, you can install and update Docker from the repository.

  1. Set up Docker's apt repository.



# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo docker run hello-world 
sudo apt update


sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin



sudo systemctl status docker
sudo systemctl start docker
sudo docker run hello-world












Deployment

You can choose to deploy Portainer using docker run or via Docker Compose.

To install using docker run, first create the volume that Portainer Server will use to store its database:

docker volume create portainer_data

Then, download and install the Portainer Server container:



docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:lts

By default, Portainer generates and uses a self-signed SSL certificate to secure port 9443. Alternatively you can provide your own SSL certificate during installation or via the Portainer UI after installation is complete.

If you require HTTP port 9000 open for legacy reasons, add the following to your docker run command:

-p 9000:9000

Portainer Server has now been installed. You can check to see whether the Portainer Server container has started by running docker ps:


root@server:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7963585688a9 portainer/portainer-ce:lts "/portainer" 8 seconds ago Up 8 seconds
How do I find, skip, or customize my setup token? | Portainer Documentation

How do I retrieve my token?

Your setup token must be retrieved from your Portainer server logs. How you access your logs will depend on the environment that you have installed Portainer on. Run the relevant command in a terminal on the machine where Portainer is installed.

Environment

Command

Notes

Docker Standalone

docker logs <container>

Replace <container> with your Portainer container name or ID. Run docker ps to find it.




Formation Docker (Tutoriel)


DOCKER CLI


Ajouter l'utilisateur au groupe docker

Par défaut, seul root peut utiliser Docker. Ajoutez votre utilisateur au groupe docker :

Fenêtre de terminal
# Ajouter l'utilisateur courant au groupe docker
sudo usermod -aG docker $USER
# Appliquer les changements (sans déconnexion)
newgrp docker
# Ou déconnectez-vous et reconnectez-vous
# Activer le démarrage au boot
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
# Vérifier le statut
sudo systemctl status docker



# Version client et serveur
docker version
# Informations système détaillées
docker info
# Test fonctionnel complet
docker run hello-world










                                                                                                                    

No comments:

Post a Comment

Networking Fundamentals Course

CISCO SYSTEMS                                                         in this blog we will learn together the different  layer 2 and 3 netwo...