-
Notifications
You must be signed in to change notification settings - Fork 106
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
Windows support for Git Bash and WSL #26
Conversation
@cmosguy would love your opinion as well. I still don't have time (nor a PC) to test on Windows! (I'll get my windows 10 bootcamp partition in gear one of these days). |
@cringer and @fideloper I just pulled in this latest update. Everything seems to work just fine. I'd say at this point is to ship it! |
Nice, will try this out soon! |
Hey @fideloper, any news on this. I would like to start using it on a Windows OS :) |
You can use the branch in my fork until @fiedloper pulls this in. You just have to add some stuff to your composer.json. The dot's just represent where your other content may be.
If you do end up using it from the fork please let us know if you ran into any issues. I know Windows is not @fideloper forte so the more testers the better. 😁 |
Apologies for not pulling it in yet. I don't have a way to test it which is a big blocker, I'm honestly not sure if this covers most use cases for the average windows user or if a very specific set of tools needs to be used (I haven't paid close enough attention, a new baby at home is making it hard to spend the hours!). Any feedback in terms of pros/cons/possible issues in this from the windows users will be appreciated! |
@fideloper I understand completely. What I can say is I have used different development environments on windows for a long time - WAMP, XAMPP, MAMP, Cygwin, GOW (GNU on Windows) Babun, Docker, WSL (Windows Subsystem for Linux) as well as various terminals Command Prompt, Power Shell, Git Bash (mintty), ConsoleZ, ConEmu, Cmder, Hyper. I personally have found that I am not trying to reproduce a whole Linux environment. 99% of what I do I just use Git Bash with a local PHP installation (needed for composer). Also I am mostly doing Laravel development so I'm either using php artisan serve, or the local PHP webserver for other types of projects. With that being said I'm not sure how to determine the average Windows use but I believe that it falls into 3 uses.
Use case 1 and 2 above are supported in this PR as we have the capability to run bash scripts. Only a few tweaks in the script were necessary for default values and environment detection. For option 3 there would need to be a windows specific script to perform what your bash script does. I haven't had a chance to look too deep into this as I haven't had time but I'm sure it would need to be provided by the community. Just my two cents. 😁 |
Thanks, really appreciate you taking the time to explain it! It looks like the changes won't over-write or change anything based on the most recent version (2.0.0) either, so let's merge it in and see what happens! |
I'll keep an eye on the issues tracker for anything windows related. |
Hi guys. So I did try this, but I am having an issue the MySQL container. When I do ./vessel start
I did try and remove the MySQL container, but it did not help. Any ideas @cringer Update |
My guess is you have something on your Windows machine listening on port 3306 already (maybe mysql running within WAMP or similar?) That being said, you'll also need to pull this package from composer require shipping-docker/vessel:dev-master |
I just followed the docs for a fresh install, and everything seems to be working for me. I can see in the Not sure why is it working :) |
Windows support for Git Bash and WSL
Windows Support
There are (potentially) 3 ways Windows developers would access Vessel and/or Docker
Since the Vessel script is written in bash the 3rd option is really it's own thing. The first 2 options give us a bash shell (with other common GNU utils like sed) in which we can utilize the bash script.
Notes on things added
I didn't use Windows as a result of a detection because I figured this would be reserved for native windows support and I don't want to confuse people. Instead the MINGW64 is being used.
Using
$(uname -s)
on WSL will just return "Linux". Because of this we need to add a detection method for WSL. Fortunately the output of /proc/version differs as WSL adds Microsoft to their version name. We can grep this output for Microsoft to determine it is WSL instead of a Linux OS.Differences between #20 and this PR
COMPOSE_CONVERT_WINDOWS_PATHS=1
doesn't appear to be necessary. The documentation only states Docker Toolbox (legacy) or docker-machine.COMPOSE="winpty $COMPOSE"
While winpty is necessary in some cases but ONLY if you are using Mintty as the default terminal for Git Bash. This choice is made during the installation of Git for Windows. If you are using the standard command prompt this is not needed at all. I haven't ran into any issues from the Vessel executing script using Mintty. The only time I have had to use this is when I'm trying to log onto one of the containers interactively. In this case it prompts me to try prefixingwinpty
in which I just do that and everything works.SEDCMD="sed -i"
under the MING64 detection. It was missing from that PR and so the substitutions under Setting .env variables were not working correctly.This script was tested on 2 different Windows machines; 1 domain joined laptop, and 1 custom desktop PC. Both are running Windows 10 Pro, Version 1709 Build 162999.19 (Creators Update)
Docker for Windows (Docker Community Edition) Version 17.09.0-ce-win33 (13620)
This PR would close #20