首页 > 编程知识 正文

ubuntu开机自动启动软件,电脑开机自动启动程序

时间:2023-05-03 07:55:54 阅读:213650 作者:1256

重启策略:

使用在Docker run的时候使用--restart参数来设置。

no - container不重哭泣的大侠/p>

on-failure - container推出爱撒娇的吐司非0时重哭泣的大侠/p>

always - 始终重哭泣的大侠/p>

https://docs.docker.com/reference/commandline/cli/#restart-policies

Restart Policies

Using the --restart flag on Docker run you can specify a restart policy for how a container should or should not be restarted on exit.

no - Do not restart the container when it exits.

on-failure - Restart the container only if it exits with a non zero exit status.

always - Always restart the container regardless of the exit status.

You can also specify the maximum amount of times Docker will try to restart the container when using theon-failure policy. The default is that Docker will try forever to restart the container.

$ sudo docker run --restart=always redis

This will run the redis container with a restart policy of always so that if the container exits, Docker will restart it.

$ sudo docker run --restart=on-failure:10 redis

This will run the redis container with a restart policy of on-failure and a maximum restart count of 10. If the redis container exits with a non-zero exit status more than 10 times in a row Docker will abort trying to restart the container. Providing a maximum restart limit is only valid for the on-failure policy.

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。