informatica:linux:docker
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
informatica:linux:docker [2019/09/05 10:16] – javi | informatica:linux:docker [2020/02/09 17:11] – [Cambiar politica de reinicio de contenedor] jose | ||
---|---|---|---|
Line 121: | Line 121: | ||
====== Cambiar politica de reinicio de contenedor ====== | ====== Cambiar politica de reinicio de contenedor ====== | ||
+ | https:// | ||
- | Con el contenedor corriendo: | + | Miramos que política tiene: |
+ | docker inspect container_name| jq -r ' | ||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ^Flag^Description^ | ||
+ | |no|Do not automatically restart the container. (the default)| | ||
+ | |on-failure|Restart the container if it exits due to an error, which manifests as a non-zero exit code.| | ||
+ | |always|Always restart the container if it stops. If it is manually stopped, it is restarted only when Docker daemon restarts or the container itself is manually restarted. (See the second bullet listed in restart policy details)| | ||
+ | |unless-stopped|Similar to always, except that when the container is stopped (manually or otherwise), it is not restarted even after Docker daemon restarts.| | ||
+ | |||
+ | |||
+ | Para cambiarlo | ||
docker update --restart unless-stopped container_name | docker update --restart unless-stopped container_name | ||
Line 1095: | Line 1112: | ||
docker stop test && docker rm test && docker rmi localhost/ | docker stop test && docker rm test && docker rmi localhost/ | ||
</ | </ | ||
+ | |||
+ | ====== Timezone ====== | ||
+ | |||
+ | Para ganar tiempo dejo algunos ejemplos de cómo configurar el timezone dependiendo de la imagen | ||
+ | |||
+ | ===== Alpine ===== | ||
+ | |||
+ | Hay que hacer 2 cosas: | ||
+ | |||
+ | 1. Instalar el paquete " | ||
+ | |||
+ | < | ||
+ | apk add tzdata | ||
+ | </ | ||
+ | |||
+ | 2. Configurar la variable de entorno " | ||
+ | |||
+ | ===== Debian (p.ej.python: | ||
+ | |||
+ | Hay que hacer 1 cosa: | ||
+ | |||
+ | 1. Crear un enlace simbólico. En este ejemplo usamos la variable " | ||
+ | |||
+ | < | ||
+ | ln -snf / | ||
+ | </ | ||
+ | |||
+ | |||
====== Errores ====== | ====== Errores ====== | ||
Line 1304: | Line 1349: | ||
</ | </ | ||
+ | |||
+ | ===== does not match any of the regexes: ' | ||
+ | |||
+ | Error completo: | ||
+ | |||
+ | < | ||
+ | ERROR: The Compose file ' | ||
+ | networks.network-rafa-db value ' | ||
+ | </ | ||
+ | |||
+ | **Causa** | ||
+ | |||
+ | Un bloque, en este caso dentro de networks, no está alineado correctamente | ||
+ | |||
+ | **Solución** | ||
+ | |||
+ | 1. Identificar el bloque, en este caso " | ||
+ | |||
+ | 2. Revisar las entradas. Una de ellas tiene un espacio de más o de menos | ||
+ |
informatica/linux/docker.txt · Last modified: 2023/03/16 10:18 by jose