mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-28 04:35:27 +00:00
Add blank lines before headers
This commit is contained in:
@@ -78,6 +78,7 @@ HEALTHCHECK NONE
|
||||
使用 `curl` 或 `wget`:
|
||||
|
||||
```docker
|
||||
|
||||
## 使用 curl
|
||||
|
||||
HEALTHCHECK CMD curl -f http://localhost/ || exit 1
|
||||
@@ -90,6 +91,7 @@ HEALTHCHECK CMD wget -q --spider http://localhost/ || exit 1
|
||||
#### 数据库
|
||||
|
||||
```docker
|
||||
|
||||
## MySQL
|
||||
|
||||
HEALTHCHECK CMD mysqladmin ping -h localhost || exit 1
|
||||
@@ -143,6 +145,7 @@ services:
|
||||
### 7.12.7 查看健康状态
|
||||
|
||||
```bash
|
||||
|
||||
## 查看容器状态(包含健康信息)
|
||||
|
||||
$ docker ps
|
||||
@@ -184,6 +187,7 @@ $ docker inspect --format '{{json .State.Health}}' mycontainer | jq
|
||||
应用启动可能需要时间 (如 Java 应用)。设置 `--start-period` 可以防止在启动阶段因检查失败而误判。
|
||||
|
||||
```docker
|
||||
|
||||
## 给应用 1 分钟启动时间
|
||||
|
||||
HEALTHCHECK --start-period=60s CMD curl -f http://localhost/ || exit 1
|
||||
|
||||
Reference in New Issue
Block a user