标注
我们支持以下几类标注:
- 版本标注
- 注释(不需要 HTML 属性)
- 使用类的
{ .tip }
提示 - 重要的是,其中使用了
{ .important }
类 - 警告,使用
{ .warning }
该类 - 实验性的,使用
{ .experimental }
类 - 受限制,使用
{ .restricted }
该类
例子
笔记
get_hit_count
请注意该函数的编写方式。如果 redis 服务不可用,这个基本的重试循环允许我们多次尝试我们的请求。这在应用程序上线时启动时很有用,而且如果 Redis 服务需要在应用程序的生命周期内随时重新启动,这也使我们的应用程序更具弹性。在集群中,这还有助于处理节点之间的瞬时连接丢失。
提示
对于较小的基础映像,请使用
alpine
.
重要的
像对待密码一样对待访问令牌并保密。安全地存储您的令牌(例如,在凭证管理器中)。
警告
删除卷
默认情况下,运行时不会删除 compose 文件中的命名卷
docker compose down
。如果要删除卷,则需要添加该--volumes
标志。当您删除应用程序堆栈时,Docker 仪表板不会删除卷。
对于以下两个标注,请参阅 Docker 版本生命周期以获取有关何时使用它们的更多信息。
测试版功能
构建视图目前处于测试阶段。此功能可能会更改或从未来版本中删除。
受限制的
Docker Scout 是一个 抢先体验的 产品。
格式化
{{< introduced buildx 0.10.4 "../../release-notes.md#0104" >}}
> **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`.
{ .tip }
> **Important**
>
> Treat access tokens like your password and keep them secret. Store your
> tokens securely (for example, in a credential manager).
{ .important }
> **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 Dashboard does _not_ remove volumes when you delete the app stack.
{ .warning }
> **Beta feature**
>
> The Builds view is currently in Beta. This feature may change or be removed from future releases.
{ .experimental }
> **Restricted**
>
> Docker Scout is an [early access](/release-lifecycle/#early-access-ea)
> product.
{ .restricted }