mirror of https://github.com/docker/cli.git
181e60499f
This adds the currently selected "docker context" to the output of "docker version", which allows users to see which context is selected to produce the version output, and can be used (for example), to set the prompt to the currently selected context: (in `~/.bashrc`): ```bash function docker_context_prompt() { PS1="context: $(docker version --format='{{.Client.Context}}')> " } PROMPT_COMMAND=docker_context_prompt ``` After reloading the `~/.bashrc`, the prompt now shows the currently selected `docker context`: ```bash $ source ~/.bashrc context: default> docker context create --docker host=unix:///var/run/docker.sock my-context my-context Successfully created context "my-context" context: default> docker context use my-context my-context Current context is now "my-context" context: my-context> docker context use default default Current context is now "default" context: default> ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl> |
||
---|---|---|
.. | ||
command | ||
compose | ||
config | ||
connhelper | ||
context | ||
debug | ||
flags | ||
manifest | ||
registry/client | ||
streams | ||
trust | ||
version | ||
winresources | ||
cobra.go | ||
cobra_test.go | ||
error.go | ||
required.go | ||
required_test.go |