website/docs/segments/cli/docker.mdx
Display the current Docker context, or a list of running containers when display_mode is set to environment.
import Config from "@site/src/components/Config.js";
<Config data={{ type: "docker", style: "powerline", powerline_symbol: "\uE0B0", foreground: "#000000", background: "#0B59E7", template: " \uf308 {{ .Context }} ", options: { display_mode: "environment", docker_command: "docker", filter: "name=oh-my-posh-db-1" } }} />
| Name | Type | Default | Description |
|---|---|---|---|
display_mode | string | context | files, context, or environment |
fetch_context | boolean | true | fetch context in files mode |
docker_command | string | docker | command used in environment mode |
filter | string | passed to docker ps, see the filter documentation | |
extensions | []string | compose files and Dockerfile | overrides the file checks |
:::note default template
\uf308 {{ .Context }}
:::
| Name | Type | Description |
|---|---|---|
.Context | string | current active context |
.Containers | []Container | running containers from docker ps (environment mode only) |
| Name | Type | Description |
|---|---|---|
.ID | string | container ID |
.Image | string | container image |
.Command | string | container command |
.Created | string | created time |
.Status | string | container status |
.Ports | string | published ports |
.Names | string | container name |