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édenteProchaine révisionLes deux révisions suivantes | ||
informatique:docker [14/04/2019 13:09] – [docker run] cyrille | informatique:docker [07/05/2023 14:00] – [Mise à jour] 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 | + | C'est le reverse proxy pour d' |
+ | |||
+ | acme-companion is a lightweight companion | ||
+ | |||
+ | * Automated creation/ | ||
+ | * Let's Encrypt / ACME domain validation through http-01 challenge only. | ||
+ | * Automated update and reload of nginx config on certificate creation/ | ||
+ | * Support creation of Multi-Domain (SAN) Certificates. | ||
+ | * Creation of a Strong Diffie-Hellman Group at startup. | ||
+ | * Work with all versions of docker. | ||
+ | |||
+ | {{ https://raw.githubusercontent.com/nginx-proxy/acme-companion/main/ | ||
+ | |||
+ | Les 2 dans un docker-compose et le tour est joué: | ||
+ | <code yaml> | ||
+ | volumes: | ||
+ | conf: | ||
+ | vhost: | ||
+ | html: | ||
+ | dhparam: | ||
+ | certs: | ||
+ | acme: | ||
+ | |||
+ | services: | ||
+ | | ||
+ | image: nginxproxy/nginx-proxy | ||
+ | container_name: | ||
+ | ports: | ||
+ | - " | ||
+ | - " | ||
+ | volumes: | ||
+ | - conf:/etc/nginx/ | ||
+ | - 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 | ||
+ | <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 | ||
+ | </ | ||
- | Le conteneur nginx-proxy peut-être démarré après les virtualhosts conteneurs. C'est cool pour le boot du système ;-) | ||
==== webdevops ==== | ==== webdevops ==== | ||
Ligne 253: | Ligne 331: | ||
Exemple: | Exemple: | ||
- | < | + | < |
docker pull mysql | docker pull mysql | ||
docker stop my-mysql-container | docker stop my-mysql-container | ||
Ligne 259: | Ligne 337: | ||
docker run --name=my-mysql-container --restart=always \ | docker run --name=my-mysql-container --restart=always \ | ||
-e MYSQL_ROOT_PASSWORD=mypwd -v / | -e MYSQL_ROOT_PASSWORD=mypwd -v / | ||
+ | </ | ||
+ | |||
+ | ==== Faire le ménage ==== | ||
+ | |||
+ | <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 | ||
+ | ... | ||
</ | </ | ||
informatique/docker.txt · Dernière modification : 24/11/2023 20:44 de cyrille