跳转到主内容

Docker

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

功能

显示当前的 Docker 上下文。使用默认上下文时此功能不会激活。

示例配置

{
"type": "docker",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#000000",
"background": "#0B59E7",
"template": "  {{ .Context }} "
}

选项

NameTypeDefaultDescription
display_modestringcontext
  • files: the segment is only displayed when a file extensions listed is present
  • context: displays the segment when a Docker context active
fetch_contextbooleantruealso fetch the current active Docker context when in the files display mode
extensions[]stringcompose.yml, compose.yaml, docker-compose.yml, docker-compose.yaml, Dockerfileallows to override the default list of file extensions to validate

模板 (信息)

默认模板
\uf308 {{ .Context }}

属性

NameTypeDescription
.Contextstringthe current active context