增加 设置容器自启动 方法.
Signed-off-by: lion.chan <cy187lion@sina.com>
This commit is contained in:
parent
e459cea0f0
commit
d0e5997239
|
@ -189,7 +189,17 @@ pip install runlike
|
||||||
runlike -p <container name/id>
|
runlike -p <container name/id>
|
||||||
```
|
```
|
||||||
|
|
||||||
## 7.常用镜像
|
## 7. 设置容器自启动
|
||||||
|
|
||||||
|
1. 使用 docker run 命令运行时增加 --restart=always 参数即可;
|
||||||
|
2. 使用 docker-compose 命令运行时在 yml 文件中,需要自启动的 service 下增加 restart: always 项目即可;
|
||||||
|
3. 已运行的容器修改其自启动策略,执行命令:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker container update --restart=<no|on-failure|always> <container name/id>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 8. 常用镜像
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Ubuntu
|
# Ubuntu
|
||||||
|
|
Loading…
Reference in New Issue