标注
目录
我们支持以下主要类别的标注
- 提醒:注意、提示、重要、警告、小心
我们还支持摘要栏,用于表示功能所需的订阅、版本或管理员角色。要添加摘要栏,请执行以下操作:
将功能名称添加到 /data/summary.yaml 文件中。使用以下属性
| 属性 | 描述 | 可能的值 |
|---|---|---|
订阅 | 注明使用该功能所需的订阅 | 全部、个人、专业、团队、商业 |
可用性 | 注明该功能所处的产品开发阶段 | 实验性、Beta、早期访问、GA、已停用 |
要求 | 注明该功能所需的最低版本 | 无特定值,使用字符串描述版本并链接到相关发行说明 |
适用于 | 注明该功能是否适用于 IT 管理员 | 管理员 |
然后,在要添加摘要栏的页面上添加 `summary-bar` 简码。请注意,功能名称区分大小写。摘要栏中显示的图标将自动渲染。
示例
注意请注意 `get_hit_count` 函数的编写方式。如果 redis 服务不可用,这种基本的重试循环允许我们多次尝试请求。这在应用程序启动时以及在应用程序生命周期中 Redis 服务需要重启时都很有用。在集群中,这也有助于处理节点之间瞬间的连接中断。
提示对于较小的基础镜像,请使用 `alpine`。
重要像对待密码一样对待访问令牌,并将其保密。安全地存储您的令牌(例如,在凭证管理器中)。
警告移除卷
默认情况下,在运行 `docker compose down` 时,compose 文件中的命名卷不会被移除。如果您想移除这些卷,需要添加 `--volumes` 标志。
当您删除应用程序堆栈时,Docker Desktop Dashboard 不会移除卷。
小心此处有龙出没。
对于以下两种标注,请参阅 Docker 发布生命周期,了解何时使用它们。
格式化
{{< summary-bar feature_name="PKG installer" >}}> [!NOTE]
>
> Note the way the `get_hit_count` function is written. This basic retry
> loop lets us attempt our request multiple times if the redis service is
> not available. This is useful at startup while the application comes
> online, but also makes our application more resilient if the Redis
> service needs to be restarted anytime during the app's lifetime. In a
> cluster, this also helps handling momentary connection drops between
> nodes.
> [!TIP]
>
> For a smaller base image, use `alpine`.
> [!IMPORTANT]
>
> Treat access tokens like your password and keep them secret. Store your
> tokens securely (for example, in a credential manager).
> [!WARNING]
>
> Removing Volumes
>
> By default, named volumes in your compose file are NOT removed when running
> `docker compose down`. If you want to remove the volumes, you will need to add
> the `--volumes` flag.
>
> The Docker Desktop Dashboard does not remove volumes when you delete the app stack.
> [!CAUTION]
>
> Here be dragons.