Docker
What
Display the current Docker context, or a list of running containers when display_mode is set to environment.
Sample Configuration
- json
- yaml
- toml
{
"type": "docker",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#000000",
"background": "#0B59E7",
"template": " {{ .Context }} ",
"options": {
"display_mode": "environment",
"docker_command": "docker",
"filter": "name=oh-my-posh-db-1"
}
}
type: docker
style: powerline
powerline_symbol:
foreground: "#000000"
background: "#0B59E7"
template: " {{ .Context }} "
options:
display_mode: environment
docker_command: docker
filter: name=oh-my-posh-db-1
type = "docker"
style = "powerline"
powerline_symbol = ""
foreground = "#000000"
background = "#0B59E7"
template = " {{ .Context }} "
[options]
display_mode = "environment"
docker_command = "docker"
filter = "name=oh-my-posh-db-1"
Options
| 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 |
Template (info)
default template
\uf308 {{ .Context }}
Properties
| Name | Type | Description |
|---|---|---|
.Context | string | current active context |
.Containers | []Container | running containers from docker ps (environment mode only) |
Container
| 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 |