Tell us about your request
I would like to see an easy docker context switching menu in Docker Desktop. Basically the same as there is for Kubernetes for switching kubeconf contexts. I do not expect it to be GUI for managing contexts (create/update/rm), just switch.
Which service(s) is this request for?
Docker Desktop (all platforms)
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
Switching context is possible by docker context use mycontext which is not much, but why couldn't we have it in two clicks in parity with the Kubernetes menu item?
Are you currently working around the issue?
n/a
Additional context
none
Hey @iben12 thanks for raising this!
I like the idea of adding it like the K8s context, do you think there would be no value in the ability to add via the main UI as well?
And do you think we should do anything with the 'whale icon' in the menu bar to indicate what context people are using? 馃
Well, I was aiming on something that needs minimal effort, but would make life a tiny bit easier. Regarding a UI that makes possible to manage contexts (if you meant that), that would be a great addition, especially for less experienced users.
For the icon to indicate current context, honestly I don鈥檛 know. If someone has multiple contexts, how could that appear on the tiny icon? However, and I had issues with that in my own experience, if just indicating if I鈥檓 on local or a remote context would be possible, that could really help. I took me a couple of minutes and commands to realize that why I don鈥檛 get the results I was expecting was because I was on a remote context.
Hi @iben12 . I'm currently working on the user experience of the context switching issue you brought up and would really like to get a better sense of how you are currently using contexts and how often you're switching. Any insight you could give would be helpful. For example, how many remote contexts do you usually work with? Are there any ways switching could be improved? You mentioned having a clearer marker into which context you're in to avoid confusion. What specific tasks are you usually attempting to complete when context switching? Thanks again for raising this!
Hi @stlucek,
At the moment I use two contexts: the local (default) and one remote for my swarm cluster. I switch between them on a daily basis. Of course mostly I work with the local context, but every now and then I need to change stuff in the swarm (deploy, update, restart services, stacks etc).
I have an alias set up in my .zshrc so I use dctx <context> to switch between them.
However I have another addition: sometimes I forget on what context I am on and do not understand why something (eg mounts, port mappings) do not work. When I use a docker command on a remote context, it would be really nice if the first line of the output would be something like:
Notice: You're using a remote Docker context, your command is executed on a remote server.
Above was kind of an idea that the Moby icon on the taskbar/panel could indicate the context: at least it could somehow indicate whether local or remote. That could be achieved, I guess.
Just ping me if I can help any further.
I'm going to add docker/for-mac#5512 into this request: if you could switch contexts in Docker Desktop, we would also need the dashboard to switch to reflect the current context (or show both, or something). Arguably the dashboard should switch even while context switching is only on the CLI, although we would have to have a way to indicate the current context at least otherwise it would be confusing.
I don't have any containers on my workstation, everything is remote. It would be nice to have Docker Workstation to be able to talk to remote docker instances using context's.
Most helpful comment
Well, I was aiming on something that needs minimal effort, but would make life a tiny bit easier. Regarding a UI that makes possible to manage contexts (if you meant that), that would be a great addition, especially for less experienced users.
For the icon to indicate current context, honestly I don鈥檛 know. If someone has multiple contexts, how could that appear on the tiny icon? However, and I had issues with that in my own experience, if just indicating if I鈥檓 on local or a remote context would be possible, that could really help. I took me a couple of minutes and commands to realize that why I don鈥檛 get the results I was expecting was because I was on a remote context.