-
Notifications
You must be signed in to change notification settings - Fork 46
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 dockercli context awareness #11
base: main
Are you sure you want to change the base?
Conversation
Hey @redradrat, thank you for the idea and PR! I think this is a great enhancement to the lib and has no drawback from what I can see. Can you confirm if this PR still works in a vanilla setup where the user hasn't created anything beyond the default context? I assume so, but would like to confirm. |
So the default context will work, as well as not having a context set, then it would just assume the default host. But this needs a build and more testing... I'm not sure if I get to it... I kinda just made this so I can get on with things ^^ The problem is, if there is no existing docker config, I think it would initialize a blank one... not sure if that's good. Sure... it's unlikely, as I think we can expect the cli client to be in place, because you would only use this helper if you'd be running docker on mac. So that means you probably have booted up the VM by using docker. But still... |
So it doesn't actually initialise the .docker config dir. It just assumes a "default" docker context. Which is the desired behaviour, I think. |
I did a bit of digging on this one. When I run the binary manually using The only docker server I've tested that doesn't support using the default socket is Colima, which seems to have made a design choice not to, and tells users to manually create a symlink, which is what I've been doing. |
So this is just a rough idea, as I wanted to use your tool with colima. Basically I wanted it to just work® with whatever I set as my current context in the actual docker cli.
This current implementation is ugly AF, but it works for me... so figured I'mma send you the PR to see if you'd be interested in the general idea.