docker context ls
描述 | 列出上下文 |
---|---|
用法 | docker context ls [OPTIONS] |
别名 | docker context list |
描述
列出上下文
选项
选项 | 默认值 | 描述 |
---|---|---|
--format | 使用自定义模板格式化输出 'table': 以表格格式打印输出,包含列标题(默认) 'table TEMPLATE': 使用给定的 Go 模板以表格格式打印输出 'json': 以 JSON 格式打印 'TEMPLATE': 使用给定的 Go 模板打印输出。 有关使用模板格式化输出的更多信息,请参阅 https://docs.dockerd.com.cn/go/formatting/ | |
-q, --quiet | 仅显示上下文名称 |
示例
使用 docker context ls
打印所有上下文。当前活动的上下文用 *
表示。
$ docker context ls
NAME DESCRIPTION DOCKER ENDPOINT ORCHESTRATOR
default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock swarm
production tcp:///prod.corp.example.com:2376
staging tcp:///stage.corp.example.com:2376