-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add docker context item #231
Conversation
Thanks! I'll take a look. Don't worry about mega-linter. |
Can you give me a quick run-down on how you tested this? I have everything set up, but I'm not very knowledgeable about docker. |
Sure! First, thank you for your quick feedback 😃 With docker installed, you can list contexts using Here’s Docker’s documentation about contexts including how to create and switch to a new context: https://docs.docker.com/engine/context/working-with-contexts/ Also, I didn’t know how to find a glyph so I picked one using this tool, hope this works. |
Found a problem. |
The latter is not available on all systems.
Done 👍🏻 Side note: funnily enough, docker context show is twice as fast as docker inspect + format. (58 vs 100ms) |
Thanks, looks pretty good 👍 I'll get back to this in a few days, I need to study for finals 😄 |
I'm a bit concerned about performance 😞 Even with async, I'm not super excited about 20-40 ms extra (on my machines).
|
Well, considering that docker contexts are kind of a power user feature, and power users are very likely to also have docker compose, and IIRC, compose is now bundled into docker (it’s now available as a subcommand (how were your finals? 😊) |
Just tried it out. "docker context show" on google gives very few results, and no official documentation. I think that we should follow what spacefish and starship are doing here, which is only running the item if some files exist.
Could you add that? Don't make it configurable though.
They went ok 😄 |
Yeah, I couldn't find any official documentation on Just for the record, I'm currently using version 20.10.11 of Docker Desktop for Mac. The same version on linux doesn't seem to offer Anyway, I tried with I don't think limiting this to a repository containing some arbitrary files would be useful. As with k8s contexts, this affects docker commands globally. |
Yes, it effects docker globally, but the question is when are you going to need to see it. The optimal solution AFAICT would be #90, where the docker context only shows up if your command line has We generally use the files as a proxy for that though. How often are you going to be running |
That's a very interesting question. Since I mostly use docker compose to run stuff with docker on my machine, I'd say that in this case I would nearly always have a compose or dockerfile nearby. Is the |
Yes, it's called test 😄
Fair enough. Then let's not detect files, and just have this item not be on by default 👍 (so no changes necessary) |
Merged with some changes into the fish-3.4 branch 👍 Thanks for contributing 😄 EDIT: 7224a99, gave credit :) |
Oh, dang, it didn't give you credit for any of your commits. I'll try to fix that. |
Co-authored-by: Gabriel Augendre <[email protected]>
Description
Add an item displaying the current docker context. Largely inspired by the kubectl item.
Screenshots (if appropriate)
How Has This Been Tested
Checklist