Docker Container开机自动启动
来源:互联网 发布:机械行业知乎 编辑:程序博客网 时间:2024/05/17 01:51
重启策略:
使用在Docker run的时候使用--restart参数来设置。
no - container不重启
on-failure - container推出状态非0时重启
always - 始终重启
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.
- Docker Container开机自动启动
- Docker容器开机自动启动
- centos 使用 systemctl 使 docker 容器(container)开机启动
- docker启动Container进程之启动流程
- docker container ssh服务自动断开问题
- Docker Container同时启动多服务
- Docker Container同时启动多服务 centOS6
- 程序开机自动启动
- 开机自动启动程序
- 开机自动启动程序
- 开机自动启动SVN
- 开机自动启动程序
- Winforms开机自动启动
- 开机自动启动程序
- svn开机自动启动。
- Tomcat开机自动启动
- 系统开机自动启动
- 开机自动启动GoAgent
- php邮箱验证
- POJ-2197(DFS)
- JavaBean入门 - 概念和简单例子
- HTML<textarea>标签的空格的问题
- 模型评估&AUC
- Docker Container开机自动启动
- 基于 xml 来配置 AOP -佟刚老师《Spring4视频教程》学习笔记(22)
- rem在ff和chrome下表现不一致
- 一道SQL面试题
- 【Android开发学习46】Android平台分割PNG图片成小png图片
- 理解和使用NT驱动程序的执行上下文
- (一)jquery做ajax表单提交以及字段验证
- java abstract类和interface的区别,精辟!
- LeetCode --- 61. Rotate List