Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

start.sh cannot run when called from outside its own directory #687

Open
IllyaMoskvin opened this issue Sep 4, 2017 · 1 comment
Open

Comments

@IllyaMoskvin
Copy link

IllyaMoskvin commented Sep 4, 2017

TL;DR: This is probably due to the relative DOCKER_MACHINE path definition in start.sh#L10

Basically, I installed Docker Toolbox and deselected the "VirtualBox" and "Git for Windows" options, since they were already installed... in non-default locations. This caused issues in a number or areas, mainly in that the "Docker Quickstart Terminal" shortcut refused to work (cf. #686). The path to start.sh was correct, but it assumed that Git was installed in its default location. It would try to launch it using cmd, and the terminal window would flash briefly, then exit, too fast for me to see the messages.

After running the Kitematic quick-start wizard thingy, I corrected the shortcut target to my Git Bash path:

C:\Tools\Git\git-bash.exe --login -i "C:\Tools\Docker\start.sh"

Alright, still flash-exiting. Next, I tried running it directly:

Administrator@DELL1545 MINGW64 ~
$ /c/Tools/Docker/start.sh
Docker Machine is not installed. Please re-run the Toolbox Installer and try again.
Looks like something went wrong in step ´Looking for vboxmanage.exe´...
Press any key to continue...

At least I'm not the only one having this issue. Doing this works:

Administrator@DELL1545 MINGW64 ~
$ cd /c/tools/docker

Administrator@DELL1545 MINGW64 /c/tools/docker
$ ./start.sh

I changed the shortcut target parameters to be a command call:

C:\Tools\Git\git-bash.exe -c "cd /c/tools/docker; ./start.sh"

...which worked! Interestingly, this just flash-exits:

C:\Tools\Git\git-bash.exe --c "/c/tools/docker.sh"

Maybe my syntax is wrong? Eh.

Anyway, DOCKER_MACHINE should not be relative. The script fails, because it cannot find DOCKER_MACHINE in the folder from which the script was called (start.sh#L31). One solution would be to get the directory where the script is located, and prepend it to DOCKER_MACHINE instead of using ./[...]. This would also fix #487, #496, and partially fix #662, #636.

Also, I think the shortcut is fundamentally broken, but that might be a separate issue. I don't know enough about the --login and -i flags to say for sure. See also #640, #343, #466.

@MaxPeal
Copy link
Contributor

MaxPeal commented Sep 14, 2017

can you test if in you case #689 will help?

mplevako added a commit to mplevako/toolbox that referenced this issue Aug 15, 2018
Different Git packages use different installation paths, which, in
their turn may also be redefined by the user. Moreover, even if Git
is installed there is no guarantee that the Bash component is also
present. So there is little sense to depend on Git bash or to consider
it to be at any specific location.

Resolves: docker-archive#343, docker-archive#335, docker-archive#640, docker-archive#466, docker-archive#687, docker-archive#636.

Signed-off-by: Maxim Plevako <mplevako@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants