Skip to main content

Docker

What

Display the current Docker context, or a list of running containers when display_mode is set to environment.

Sample Configuration

{
"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

NameTypeDefaultDescription
display_modestringcontextfiles, context, or environment
fetch_contextbooleantruefetch context in files mode
docker_commandstringdockercommand used in environment mode
filterstringpassed to docker ps, see the filter documentation
extensions[]stringcompose files and Dockerfileoverrides the file checks

Template (info)

default template
\uf308 {{ .Context }}

Properties

NameTypeDescription
.Contextstringcurrent active context
.Containers[]Containerrunning containers from docker ps (environment mode only)

Container

NameTypeDescription
.IDstringcontainer ID
.Imagestringcontainer image
.Commandstringcontainer command
.Createdstringcreated time
.Statusstringcontainer status
.Portsstringpublished ports
.Namesstringcontainer name