docker
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| docker [2017/11/06 13:11] – [Avoir des informations sur les containers] simon | docker [Date inconnue] (Version actuelle) – supprimée - modification externe (Date inconnue) 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== Docker ====== | ||
| - | [[https:// | ||
| - | ===== Installer Docker ===== | ||
| - | ==== Sur Raspberry Pi ==== | ||
| - | === Prérequis === | ||
| - | Un [[Raspberry Pi]] fonctionnel avec une distribution supportant Docker, comme [[Ubuntu Mate]] ou [[HypriotOS]]. Il faut que le noyau soit récent pour bénéficier de toutes les possibilités. | ||
| - | |||
| - | === Installation === | ||
| - | Sur Ubuntu Mate, on peut l' | ||
| - | <code bash> | ||
| - | $ sudo apt-get install docker.io | ||
| - | </ | ||
| - | |||
| - | === Vérifications === | ||
| - | On peut vérifier qu'il est bien installé et trouver les infos importantes avec les commandes suivantes : | ||
| - | <code bash> | ||
| - | $ sudo docker | ||
| - | Usage: docker [OPTIONS] COMMAND [arg...] | ||
| - | | ||
| - | | ||
| - | |||
| - | A self-sufficient runtime for containers. | ||
| - | |||
| - | Options: | ||
| - | |||
| - | --config=~/ | ||
| - | -D, --debug | ||
| - | -H, --host=[] | ||
| - | -h, --help | ||
| - | -l, --log-level=info | ||
| - | --tls Use TLS; implied by --tlsverify | ||
| - | --tlscacert=~/ | ||
| - | --tlscert=~/ | ||
| - | --tlskey=~/ | ||
| - | --tlsverify | ||
| - | -v, --version | ||
| - | |||
| - | Commands: | ||
| - | attach | ||
| - | build Build an image from a Dockerfile | ||
| - | commit | ||
| - | cp Copy files/ | ||
| - | create | ||
| - | diff Inspect changes on a container' | ||
| - | events | ||
| - | exec Run a command in a running container | ||
| - | export | ||
| - | history | ||
| - | images | ||
| - | import | ||
| - | info Display system-wide information | ||
| - | inspect | ||
| - | kill Kill a running container | ||
| - | load Load an image from a tar archive or STDIN | ||
| - | login | ||
| - | logout | ||
| - | logs Fetch the logs of a container | ||
| - | network | ||
| - | pause Pause all processes within a container | ||
| - | port List port mappings or a specific mapping for the CONTAINER | ||
| - | ps List containers | ||
| - | pull Pull an image or a repository from a registry | ||
| - | push Push an image or a repository to a registry | ||
| - | rename | ||
| - | restart | ||
| - | rm Remove one or more containers | ||
| - | rmi | ||
| - | run Run a command in a new container | ||
| - | save Save an image(s) to a tar archive | ||
| - | search | ||
| - | start Start one or more stopped containers | ||
| - | stats | ||
| - | stop Stop a running container | ||
| - | tag Tag an image into a repository | ||
| - | top | ||
| - | unpause | ||
| - | update | ||
| - | version | ||
| - | volume | ||
| - | wait Block until a container stops, then print its exit code | ||
| - | |||
| - | Run ' | ||
| - | |||
| - | $ sudo docker version | ||
| - | Client: | ||
| - | | ||
| - | API version: | ||
| - | Go version: | ||
| - | Git commit: | ||
| - | | ||
| - | | ||
| - | |||
| - | Server: | ||
| - | | ||
| - | API version: | ||
| - | Go version: | ||
| - | Git commit: | ||
| - | | ||
| - | | ||
| - | |||
| - | $ sudo docker info | ||
| - | [sudo] password for simon: | ||
| - | Containers: 0 | ||
| - | | ||
| - | | ||
| - | | ||
| - | Images: 0 | ||
| - | Server Version: 1.10.3 | ||
| - | Storage Driver: overlay | ||
| - | | ||
| - | Execution Driver: native-0.2 | ||
| - | Logging Driver: json-file | ||
| - | Plugins: | ||
| - | | ||
| - | | ||
| - | Kernel Version: 4.1.19-v7+ | ||
| - | Operating System: Ubuntu 16.04.1 LTS | ||
| - | OSType: linux | ||
| - | Architecture: | ||
| - | CPUs: 4 | ||
| - | Total Memory: 925.8 MiB | ||
| - | Name: rpi2 | ||
| - | ID: K5PJ: | ||
| - | WARNING: No memory limit support | ||
| - | WARNING: No swap limit support | ||
| - | WARNING: No oom kill disable support | ||
| - | WARNING: No cpu cfs quota support | ||
| - | WARNING: No cpu cfs period support | ||
| - | </ | ||
| - | |||
| - | === Bonus === | ||
| - | Pour ne pas devoir utiliser [[sudo]] et pour limiter la surface d' | ||
| - | <code bash> | ||
| - | # On ajoute le groupe docker s'il n' | ||
| - | $ sudo groupadd docker | ||
| - | |||
| - | # On ajoute l' | ||
| - | # On peut y mettre n' | ||
| - | # Il faudra peut-être de reconnecter pour que les modifications prennent effet. | ||
| - | $ sudo gpasswd -a ${USER} docker | ||
| - | |||
| - | # On redémarre le daemon. | ||
| - | $ sudo service docker restart | ||
| - | </ | ||
| - | |||
| - | ==== Sur Debian 9 Stretch ==== | ||
| - | La procédure est là : [[http:// | ||
| - | |||
| - | ===== Télécharger et utiliser des conteneurs ===== | ||
| - | ==== Mono ==== | ||
| - | Mon premier essais consiste à faire tourner un code en C# via un conteneur mono [[https:// | ||
| - | <code bash>$ docker pull mono | ||
| - | latest: Pulling from mono | ||
| - | 675952da5001: | ||
| - | c527f527316d: | ||
| - | 13be62761cfd: | ||
| - | d559e85a2176: | ||
| - | 19a0cc119d92: | ||
| - | d1ddf658ac76: | ||
| - | Digest: sha256: | ||
| - | Status: Downloaded newer image for mono:latest | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ docker build -t drone-test . | ||
| - | Sending build context to Docker daemon 20.99 kB | ||
| - | Sending build context to Docker daemon | ||
| - | Step 0 : FROM mono: | ||
| - | 3.10-onbuild: | ||
| - | 2cbc5686618a: | ||
| - | ab0ae6bb20f1: | ||
| - | 86f977c7a3e6: | ||
| - | 6b14d937da83: | ||
| - | f973886e468c: | ||
| - | 82a2a1e130db: | ||
| - | e04b34b9f606: | ||
| - | f69cd3d8fb2d: | ||
| - | 4ae5a5dcc234: | ||
| - | 3a0b1f94c975: | ||
| - | 4f5c6ddeb70b: | ||
| - | 675952da5001: | ||
| - | c527f527316d: | ||
| - | 13be62761cfd: | ||
| - | d559e85a2176: | ||
| - | Digest: sha256: | ||
| - | Status: Downloaded newer image for mono: | ||
| - | # Executing 4 build triggers | ||
| - | Trigger 0, COPY . / | ||
| - | Step 0 : COPY . / | ||
| - | Trigger 1, RUN nuget restore -NonInteractive | ||
| - | Step 0 : RUN nuget restore -NonInteractive | ||
| - | | ||
| - | This folder contains no solution files, nor packages.config files. | ||
| - | INFO[0040] The command [/bin/sh -c nuget restore -NonInteractive] returned a non-zero code: 1 | ||
| - | </ | ||
| - | |||
| - | ===== Commandes utiles ===== | ||
| - | ==== Démarrer/ | ||
| - | <code bash> | ||
| - | $ docker start cptactionhank/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ docker stop gitlab | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | </ | ||
| - | |||
| - | ==== Avoir des informations sur les containers ==== | ||
| - | <code bash> | ||
| - | $ docker ps | ||
| - | CONTAINER ID IMAGE | ||
| - | ab2180a9e20f | ||
| - | 9118afb6987c | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ docker ps -a | ||
| - | CONTAINER ID IMAGE | ||
| - | ab2180a9e20f | ||
| - | f341e0f8de10 | ||
| - | 9118afb6987c | ||
| - | 9ff27779cbe4 | ||
| - | 4e6d1af014eb | ||
| - | c5222668e5e2 | ||
| - | c1444e3e3239 | ||
| - | a8841c425532 | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ docker images | ||
| - | REPOSITORY | ||
| - | cptactionhank/ | ||
| - | gitlab/ | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | $ docker inspect jira | ||
| - | </ | ||
| - | |||
| - | ==== Informations sur les volumes ==== | ||
| - | <code bash> | ||
| - | $ docker volume ls | ||
| - | </ | ||
| - | ===== Liens et références ===== | ||
| - | - [[http:// | ||
| - | - [[https:// | ||
| - | - [[http:// | ||
docker.1509973860.txt.gz · Dernière modification : (modification externe)
