-
Notifications
You must be signed in to change notification settings - Fork 2k
windows: bash-style eval shown in cmd.exe/powershell #733
Comments
Thanks! I think, for now at least, we recommend that users install msysgit which gives them bash I believe and this works. I agree with you we need to get to supporting cmd.exe/powershell at some point. |
@ehazlett I am hoping to help with that in the long term. I wasn't aware of msysgit recommendation since I haven't seen it in the docs https://docs.docker.com/machine/ |
@ahmetalpbalkan ugh well then it was removed from the readme. It was in there at one point. I'll get it back. Thanks! |
and thanks for helping! it is greatly appreciated! |
The console on windows bothers me. Perhaps we can have console adapters, especially one for windows. |
Perhaps depending on the parent process For a To point your Docker client at it, run this in your shell: for /f "tokens=2" %i in ('docker-machine env docker-vb') do set %i There should be a similar solution running from a powershell, but I haven't tried it yet. |
There are still bunch of weird ssh-keygen/openssl bugs with mingw/cygwin installations and almost nobody can get it working right at this point. Telling people to just use |
@ahmetalpbalkan perhaps we could brainstorm the best way to support windows clients? I would like to get a "recommended" path for windows users (shell, env, etc). |
@ehazlett definitely, if this works out of the box on cmd.exe or msys very easily, that'd be nice. |
I'd be keen to help with powershell support - right now I have a powershell function that parses the export lines and sets variables accordingly, but it's not a good solution - I'd much rather docker-machine recognised it was in powershell and actually set the variables for me. |
@silarsis I recently tackled this problem in boot2docker shellinit: boot2docker/boot2docker-cli#356 Unfortunately there is no way to find out if we are running on cmd or powershell. (Unless we do win32 api calls and try to find name of parent process, which is very hacky). However we were able to support this for powershell:
Because I couldnt find an easy way to eval things in cmd.exe and I decided making powershell output the only stdout is good enough. |
I don't even mind if there's no automatic recognition - I'm new to powershell - is it possible to set env variables in a sub-process, or is that restricted the same way bash is? I ask because I'm wondering if the |
I don't know PowerShell at all. At this point, I'd settle for something that works exactly like Boot2Docker for Windows with Client Hyper-V replacing VirtualBox. If that's not possible, I'll probably end up rolling my own. On a Windows system, you have three mutually exclusive options:
You can only pick one, and right now, the second option is the only one that works. |
@silarsis setting environment variables in sub-processes doesn't due to the way operating systems work, probably not specific to bash or powershell. :) Piping it to @znmeb (1) probably won't work (2) is what we have today (3) only ships in Windows Professional SKUs and is not enabled by default. And (2)-(3) cannot coexist on the same machine (i.e. you can't use VBox while Hyper-V is enabled). Today we have machine drivers for Hyper-V and VirtualBox and I believe both works just fine on windows and I'm not sure how all these are relevant to the shellinit discussion here? 😄 |
@silarsis also, I liked the idea of something like |
+1 for |
+1 for |
@ehazlett just remembered you were asking me about this on IRC. did you write code for it or should I submit a PR? |
@ahmetalpbalkan PR - #1033 -- would love your feedback :) |
nevermind - will confirm with newer build. |
@ewindisch is SHELL or TERM set in your windows console? If so that's gonna print bash output. |
I think this should be pretty well-rounded now, but please open a new issue if there are unexpected workflow consequences. |
The command above (suggested by #733 (comment)) works for me, but I also get these two errors:
|
@jmauerhan The
This "executes" the REM comment lines without an error. |
the last line doesn't make much sense as cmd.exe/powershell won't support it. We must find the windows equivalent (can't tell from off the top of my head) or tell people what to do instead.
The text was updated successfully, but these errors were encountered: