Fix missing links

This commit is contained in:
Baohua Yang
2026-02-22 13:40:20 -08:00
parent 92ea9623b2
commit e57704271d
54 changed files with 228 additions and 224 deletions

View File

@@ -191,15 +191,15 @@ $ docker inspect --format '{{json .State.Health}}' mycontainer | jq
本节涵盖了相关内容与详细描述主要探讨以下几个方面
#### 1避免副作用
#### 1. 避免副作用
健康检查会被频繁执行不要在检查脚本中进行写操作或消耗大量资源的操作
#### 2使用轻量级工具
#### 2. 使用轻量级工具
优先使用镜像中已有的工具 ( `wget`)避免为了健康检查安装庞大的依赖 ( `curl`)
#### 3设置合理的 Start Period
#### 3. 设置合理的 Start Period
应用启动可能需要时间 ( Java 应用)设置 `--start-period` 可以防止在启动阶段因检查失败而误判
@@ -209,7 +209,7 @@ $ docker inspect --format '{{json .State.Health}}' mycontainer | jq
HEALTHCHECK --start-period=60s CMD curl -f http://localhost/ || exit 1
```
#### 4只检查核心依赖
#### 4. 只检查核心依赖
健康检查应主要关注 **当前服务** 是否可用而不是检查其下游依赖 (数据库等)下游依赖的检查应由应用逻辑处理