Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker context segment doesn't seem to recognize DOCKER_CONTEXT environment variable #350

Closed
scottslowe opened this issue Apr 18, 2022 · 0 comments · Fixed by #351
Closed
Labels

Comments

@scottslowe
Copy link
Contributor

Describe the bug
The Docker context segment does not appear to recognize the DOCKER_CONTEXT environment variable, which is another way to specify the context that the Docker CLI should use.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Docker context (I used an SSH-based context to a Linux system with the Docker daemon installed).
  2. Run docker context use <new-context>. You should see a new segment show up in the prompt.
  3. Run docker context use default. The new segment will disappear.
  4. Run export DOCKER_CONTEXT=<new-context>. Note that no new segment appears in the prompt, even though the Docker CLI is correctly using the context (and docker context ls will show the specified context as the active one).

Expected behavior
I expected the Docker context segment to appear in the prompt when the DOCKER_CONTEXT environment variable is defined. This behavior is similar to the behavior of the segment that displays the name of the AWS CLI profile when the AWS_PROFILE environment variable is defined.

Environment (please complete the following information):

  • OS: macOS 12.3 on M1
  • Architecture: ARM64
  • Shell: Zsh 5.8

Additional context
None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant