informatique: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 | ||
informatique:docker [11/09/2021 17:49] – [nginx-proxy] nginx-proxy/acme-companion cyrille | informatique:docker [24/11/2023 20:44] (Version actuelle) – [Copier une image] cyrille | ||
---|---|---|---|
Ligne 203: | Ligne 203: | ||
</ | </ | ||
+ | ==== Docker Desktop ==== | ||
+ | |||
+ | https:// | ||
==== Rancher ==== | ==== Rancher ==== | ||
Ligne 209: | Ligne 212: | ||
===== Images Docker ===== | ===== Images Docker ===== | ||
- | ==== nginx-proxy ==== | + | ==== nginx-proxy |
- | * https://hub.docker.com/r/ | + | * https://github.com/nginx-proxy/ |
- | * https:// | + | * https:// |
- | Le container [[https:// | + | C'est le reverse proxy pour d' |
- | + | ||
- | ==== nginx-proxy/ | + | |
- | + | ||
- | https:// | + | |
acme-companion is a lightweight companion container for nginx-proxy. It handles the automated creation, renewal and use of LetsEncrypt SSL certificates for proxied Docker containers through the ACME protocol. | acme-companion is a lightweight companion container for nginx-proxy. It handles the automated creation, renewal and use of LetsEncrypt SSL certificates for proxied Docker containers through the ACME protocol. | ||
Ligne 228: | Ligne 227: | ||
* Creation of a Strong Diffie-Hellman Group at startup. | * Creation of a Strong Diffie-Hellman Group at startup. | ||
* Work with all versions of docker. | * Work with all versions of docker. | ||
+ | |||
+ | {{ https:// | ||
+ | |||
+ | Les 2 dans un docker-compose et le tour est joué: | ||
+ | <code yaml> | ||
+ | volumes: | ||
+ | conf: | ||
+ | vhost: | ||
+ | html: | ||
+ | dhparam: | ||
+ | certs: | ||
+ | acme: | ||
+ | |||
+ | services: | ||
+ | nginx-proxy: | ||
+ | image: nginxproxy/ | ||
+ | container_name: | ||
+ | ports: | ||
+ | - " | ||
+ | - " | ||
+ | volumes: | ||
+ | - conf:/ | ||
+ | - vhost:/ | ||
+ | - html:/ | ||
+ | - dhparam:/ | ||
+ | - certs:/ | ||
+ | - / | ||
+ | network_mode: | ||
+ | acme-companion: | ||
+ | image: nginxproxy/ | ||
+ | container_name: | ||
+ | volumes_from: | ||
+ | - nginx-proxy | ||
+ | volumes: | ||
+ | - certs:/ | ||
+ | - acme:/ | ||
+ | - / | ||
+ | network_mode: | ||
+ | </ | ||
+ | |||
+ | Il suffit ensuite de lancer des containers avec les ENV qui vont bien: | ||
+ | <code bash> | ||
+ | docker run -d -p 8000:8000 --name dokuwiki -v $(pwd)/ | ||
+ | --env " | ||
+ | --env " | ||
+ | --env " | ||
+ | --env " | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Et voilà le container '' | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | Il reste un mauvais point: le container '' | ||
+ | </ | ||
+ | |||
+ | On le voit sur le port '' | ||
+ | < | ||
+ | # netstat -tanp | grep LISTEN | ||
+ | tcp 0 0 0.0.0.0: | ||
+ | tcp 0 0 127.0.0.1: | ||
+ | tcp6 | ||
+ | tcp6 | ||
+ | tcp6 | ||
+ | tcp6 | ||
+ | tcp6 | ||
+ | </ | ||
==== webdevops ==== | ==== webdevops ==== | ||
Ligne 256: | Ligne 322: | ||
Une image fullstack (Etherpad-lite, | Une image fullstack (Etherpad-lite, | ||
* [[https:// | * [[https:// | ||
+ | |||
+ | ==== openssh ==== | ||
+ | |||
+ | Easily launch two hosts waiting for you on SSH port 22, with docker-compose -> https:// | ||
===== Tips & tricks ===== | ===== Tips & tricks ===== | ||
Ligne 265: | Ligne 335: | ||
Exemple: | Exemple: | ||
- | < | + | < |
docker pull mysql | docker pull mysql | ||
docker stop my-mysql-container | docker stop my-mysql-container | ||
Ligne 272: | Ligne 342: | ||
-e MYSQL_ROOT_PASSWORD=mypwd -v / | -e MYSQL_ROOT_PASSWORD=mypwd -v / | ||
</ | </ | ||
+ | |||
+ | ==== Copier une image ==== | ||
+ | |||
+ | Pour utiliser une image construite sur une machine il faut l' | ||
+ | < | ||
+ | # Export | ||
+ | docker save cyrille/ | ||
+ | # Import | ||
+ | gunzip cyrille-seriously-v1.tgz | docker load | ||
+ | | ||
+ | # Pour les images sans tag: | ||
+ | docker tag 4e1a2b349b09 some/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Faire le ménage ==== | ||
+ | |||
+ | Show docker disk usage : | ||
+ | <code bash> | ||
+ | $ docker system | ||
+ | TYPE TOTAL | ||
+ | Images | ||
+ | Containers | ||
+ | Local Volumes | ||
+ | Build Cache | ||
+ | </ | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | <code bash> | ||
+ | $ sudo docker system prune | ||
+ | WARNING! This will remove: | ||
+ | - all stopped containers | ||
+ | - all networks not used by at least one container | ||
+ | - all dangling images | ||
+ | - all dangling build cache | ||
+ | |||
+ | Are you sure you want to continue? [y/N] y | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | * Remove all stopped containers : '' | ||
+ | * Remove unused images : '' | ||
+ | * Remove all unused networks : '' | ||
+ | |||
==== Container’s configuration ==== | ==== Container’s configuration ==== |
informatique/docker.1631375363.txt.gz · Dernière modification : 11/09/2021 17:49 de cyrille