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> |
||
---|---|---|
.. | ||
docker-client-version.golden | ||
docker-info-badsec.golden | ||
docker-info-badsec.json.golden | ||
docker-info-daemon-warnings.json.golden | ||
docker-info-errors.golden | ||
docker-info-errors.json.golden | ||
docker-info-legacy-warnings.json.golden | ||
docker-info-no-swarm.golden | ||
docker-info-no-swarm.json.golden | ||
docker-info-plugins-warnings.golden | ||
docker-info-plugins.golden | ||
docker-info-plugins.json.golden | ||
docker-info-warnings.golden | ||
docker-info-with-swarm.golden | ||
docker-info-with-swarm.json.golden |