-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Windows] A More robuse "Docker Quickstart Terminal" #578
Conversation
Not sure, but is it worth supporting the new Windows Bash (i.e. Bash on Ubuntu on Windows) rather than "hardcoding" git bash? Also, install location of git bash may be different? Ubunto on Windows bash is at: C:\Windows\System32\bash.exe |
@somombo did you forget content with that comment? :) |
@powareverb yup! Sorry must have accidentally hit submit. What I meant to say: Bash on Ubuntu on Windows (BUW) is in its own linux subsystem.. just like it doesn't make sense to have docker toolbox for Linux it therefore wouldn't make sense to have docker toolbox for BUW.. hope this makes sense.. basically Docker is already natively supported on Linux.. so no need for the toolbox layer that emulates linux through a vm |
@somombo Yeah, I'm aware it's running as a Linux subsystem. I'm currently using docker-toolbox for the tools, plus BUW and running a custom image in HyperV (though you could just as easily use virtualbox). This is due to the fact I don't like the direction Docker for Windows is headed, but I may have to go back to it yet. But yeah, I can see the PR changes you've made are checking registry, so not useful for BUW. |
Yep.. I personally intentionally opt not to use the hyperV version of docker because installing hyperV makes it so I can't use virtualbox for my other development stuff e.g. Genymotion Android Emulator which only runs using virtualbox. Apparently, when you install hyperV you can't use any other hypervisors including Vmware's |
I closed my PR #321 as I believe this is easier to maintain in the long run, than having a dedicated powershell script. |
I'd prefer a single script that gets docker ready to use and injects any environment variables I need into the current terminal. For example instead of just your single script, maybe add another two such as
e.g. for powershell
It then becomes much easier as I can now call docker, docker-machine etc from my current terminal. |
@MartinSGill First of all thank you so much for your support.. I really appreciate the extra effort you put into contributing to this endeavor? I would like to clarify.. is the sole objective of the changes you have suggested above merely to allow one to be able to run the |
Yes, that's pretty much it. For my preferred workflow I'd simply like to inject everything I need into the current shell. I still use the Start-DockerMachine script I created in #321 whenever I need docker. In the powershell world ideally it would be a module that I could load/unload on demand, but the above solution works for me and has the advantages that it's much easier to maintain and keep in line with changes to the primary bash script. |
Maybe I'm missing something but the built in Docker-Machine env command configures command prompt for invoking docker commands directly by setting the appropriate environment variables. I'm of the opinion that setup should permanently persist the environment variables so I don't have to run the script every time I open a command prompt. To modify the env script to accomplish this, it should use setx, not set, on Windows. setx persists the environment variables, set does not. setx has a slightly different syntax, for instance the first variable set would be: This also causes docker/kitematic#2050 |
@carlin-q-scott Thanks for emphasizing the importance of that.. This PR in fact already took using SETX into account for precisely the reasons you have mentioned (refer to commit 3c3e184) |
@MartinSGill Sorry for my late response. I am still not sure what the effective benefit is to having three seperate scripts start-docker.cmd, start-docker.ps1 and start-docker.sh when, as it currently stands, the solution presented by this PR runs just find in all the three environments. Beyond simply making docker work in all three environments, is there perhaps something else I am missing about the extra advantage to having the three script files? |
Hi @nathanleclaire, this pr's been open half a year. Any feedback? |
Hm, I'm a bit confused by the scope and purpose. This is so that the Toolbox binaries are available in every shell? Could we change the installer to update the system path so that this is possible instead? |
@nathanleclaire that's what the PR does. I think @MartinSGill was proposing some alternative solution that's more complicated than the PR. |
@nathanleclaire sorry I took so long to respond for some reason, I didn't realise that you had posted a message. @carlin-q-scott is correct, in summary, this PR does two things:
Hope this clarifies things. |
@nathanleclaire , Either way i fine, we just really need some feedback. /cc @JeffDM, @mchiang0610, @lisean106 @FrenchBen |
Would be really nice to have such feature. Without it I can't write a single CMD file that will run a DQT, build a machine and run it. I have to run DQT from start menu, then select a bash file with commands. |
Actually, have found a way to run docker and open shell with one command. For this I have created two files:
This way it takes only one command - up.bat to open DQT, build and run the system. |
/cc @shin- |
As someone that has recently had to switch from Docker for Windows, to Docker Toolbox because I needed to use VirtualBox for Android emulation, this is extremely frustrating. Will this PR be looked at? |
@shin- are you going to give any kind of response ? Even a negative one is okay. Just some feedback please. |
@somombo Sorry, we haven't been very diligent on the Toolbox stuff. Code LGTM, do you mind rebasing against master again? |
DOCKER_TOOLBOX_INSTALL_PATH was defined prior, but not added to the users PATH environment variable. Hence commands such as docker, docker-machine, docker-compose do not work unless either they are absolutely qualified or the current directory happens to be %DOCKER_TOOLBOX_INSTALL_PATH% Signed-off-by: Chisomo Sakala <chisomo.sakala@mombo.solution>
-Removed hard coded reference "/c/Program Files/Docker Toolbox" replacing it with $DOCKER_TOOLBOX_INSTALL_PATH -Added quotes around string variables that refer to things such as paths that could potentially have spaces after expansion -Permanently set environment variables DOCKER_HOST, DOCKER_CERT_PATH, DOCKER_MACHINE_NAME, DOCKER_TLS_VERIFY etc using windows SETX instead of the default SET that's provided by `docker-machine env` . Signed-off-by: Chisomo Sakala <chisomo.sakala@mombo.solution>
…rompt OR Powershell. This plus the more robust start.sh allows docker commands to be invoked from any terminal in Windows. The command docker-terminal can also accept regular docker commands such as - docker-terminal docker ps -a - docker-terminal docker-compose --version Signed-off-by: Chisomo Sakala <chisomo.sakala@mombo.solution>
Thank you @shin-! I have rebased it. Let me know if there's anything else I can do. |
Thank you! It'll be including in the upcoming 18.03 release. |
These are variables that would have been permanently set during quick-start as per issue docker-archive#578 Signed-off-by: Somo S <somo@mombo.solutions>
This was meant to have been included as part of commit c38f335 in pull-request docker-archive#578. But was not due to an oversight. Signed-off-by: Somo S <somo@mombo.solutions>
Scripts work as explained. And an excellent indeed. |
Hi all, I have now fixed a bug or rather, an 'oversight', that was introduced here. Kindly help with reviewing #765 |
These are variables that would have been permanently set during quick-start as per issue #578 Signed-off-by: Somo S <somo@mombo.solutions>
Applies to Windows only
This PR is the culmination of a few changes I made in to my docker toolbox build and setup, in order to be able to easily use
docker
,docker-compose
from any terminal in windows i.e. cmd, powershell, git-bash etcIt is quite tedious to only have access to the
docker
command through the "Docker Quickstart Terminal" (DQT) on the start menu. Moreover DQT is setup to start from the same directory each time; in real day-to-day work, this is almost never the directory you want to be in.I have made changes to the start.sh script to make it portable. I have also introduced the file docker-terminal.cmd which simply runs the start.sh.. The advantage of docker-terminal is that one can simply open up their project in a specific directory (e.g. with "Open command window here" or "Git bash here") and run
docker-terminal
from either powershell or command prompt (or git-bash), and this will run the start.sh script: no need to go to you start menu to look for Quickstart Terminal!What's even better is you only need to run docker-terminal once. Thereafter, you can now use docker, docker-compose etc from powershell or cmd and not rely on having to use the DQT git-bash.
I'd like to invite constructive advice and improvements to this wherever you all feel it can be better!
Thanks!