User Tools

Site Tools


informatica:linux:docker

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
informatica:linux:docker [2019/10/11 10:33]
javi
informatica:linux:docker [2020/02/09 18:11] (current)
jose [Cambiar politica de reinicio de contenedor]
Line 121: Line 121:
  
 ====== Cambiar politica de reinicio de contenedor ====== ====== Cambiar politica de reinicio de contenedor ======
 +https://​docs.docker.com/​config/​containers/​start-containers-automatically/​
  
-Con el contenedor corriendo:+Miramos que política tiene: 
 +  docker inspect container_name| jq -r '​.[0].HostConfig.RestartPolicy'​ 
 +<​code>​ 
 +
 +  "​Name":​ "​always",​ 
 +  "​MaximumRetryCount":​ 0 
 +
 +</​code>​ 
 + 
 +^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
informatica/linux/docker.1570782798.txt.gz · Last modified: 2019/10/11 10:33 by javi