Outils pour utilisateurs

Outils du site


francois:docker

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
francois:docker [2018/09/16 08:50] – [docker] francoisfrancois:docker [2022/12/25 18:59] (Version actuelle) – francois
Ligne 1: Ligne 1:
-====== Docker usage ======+====== Utilisation de Docker ======
  
-## List Docker CLI commands +===== Environnement de dev Ardupilot =====
-  docker +
-  docker container --help+
  
-## Display Docker version and info +==== Construction de l'image ====
-  docker --version +
-  docker version +
-  docker info+
  
-## Execute Docker image +  docker build . -t ardupilot 
-  docker run hello-world+
  
-## List Docker images +==== Démarrage de l'image ==== 
-  docker image ls+   
 +  docker run --rm -it -v `pwd`:/ardupilot ardupilot:latest bash
  
-## List Docker containers (running, all, all in quiet mode) +===== Environnement de dev px4 =====
-  docker container ls +
-  docker container ls --all +
-  docker container ls -aq+
  
 +==== Dockerfile ====
  
-==== Installation ====+<code Dockerfile> 
 +#This is a sample Image 
 +FROM ubuntu:20.04
  
-First, update your existing list of packages:+RUN apt-get update 
 +RUN apt-get install -y wget 
 +RUN wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/ubuntu.sh
  
-    sudo apt update+RUN wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/requirements.txt 
 +RUN bash ubuntu.sh
  
-Next, install a few prerequisite packages which let apt use packages over HTTPS:+CMD [“echo”,”Image created”]
  
-    sudo apt install apt-transport-https ca-certificates curl software-properties-common+</code>
  
-Then add the GPG key for the official Docker repository to your system:+==== Création de l'image ====
  
-    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -+  docker build -t px4env:0.1 .
  
-Add the Docker repository to APT sources:+==== Démarrage de l'image ====
  
-    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"+  docker run --rm -it -v /mnt/donnees/francois/autopilot/PX4-Autopilot px4env:latest bash
  
-Next, update the package database with the Docker packages from the newly added repo: 
- 
-    sudo apt update 
- 
-Make sure you are about to install from the Docker repo instead of the default Ubuntu repo: 
- 
-    apt-cache policy docker-ce 
- 
-You'll see output like this, although the version number for Docker may be different: 
-Output of apt-cache policy docker-ce 
- 
-docker-ce: 
-  Installed: (none) 
-  Candidate: 18.03.1~ce~3-0~ubuntu 
-  Version table: 
-     18.03.1~ce~3-0~ubuntu 500 
-        500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages 
- 
-Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 18.04 (bionic). 
- 
-Finally, install Docker: 
- 
-    sudo apt install docker-ce 
- 
-==== Configuration ==== 
- 
-By default, the docker command can only be run the root user or by a user in the docker group, which is automatically created during Docker's installation process. If you attempt to run the docker command without prefixing it with sudo or without being in the docker group, you'll get an output like this: 
- 
-Output 
-docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?. 
-See 'docker run --help'. 
- 
-If you want to avoid typing sudo whenever you run the docker command, add your username to the docker group: 
- 
-    sudo usermod -aG docker ${USER} 
- 
-To apply the new group membership, log out of the server and back in. 
- 
-==== docker examples ==== 
- 
-  docker search mariadb 
-  docker pull mariadb 
-  docker run --name dbserver -e MYSQL_ROOT_PASSWORD=mypass -d mariadb 
- 
-Pour voir si elle est démarrée 
-  docker ps 
- 
-Pour s'y connecter et changer la config 
-  docker exec -it dbserver bash 
- 
-Pour arréter le serveur 
-  docker stop dbserver 
- 
-Pour redémarrer le serveur 
-  docker start dbserver 
-  docker restart dbserver 
  
francois/docker.1537087828.txt.gz · Dernière modification : (modification externe)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki