Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

boot2docker shellinit on Windows prints commands that can not be used in cmd.exe or in a cygwin terminal #301

Closed
gmlewis opened this issue Oct 28, 2014 · 3 comments

Comments

@gmlewis
Copy link
Contributor

gmlewis commented Oct 28, 2014

Did the output from boot2docker shellinit change recently on Windows?

We used to not require cygwin, correct? With v1.3.0, I get:

> boot2docker shellinit
Writing C:\Users\gmlewis\.boot2docker\certs\boot2docker-vm\ca.pem
Writing C:\Users\gmlewis\.boot2docker\certs\boot2docker-vm\cert.pem
Writing C:\Users\gmlewis\.boot2docker\certs\boot2docker-vm\key.pem
    export DOCKER_CERT_PATH=C:\Users\gmlewis\.boot2docker\certs\boot2docker-vm
    export DOCKER_TLS_VERIFY=1
    export DOCKER_HOST=tcp://192.168.59.105:2376

export only works in a cygwin terminal... and if I run the commands, I get:

$ echo $DOCKER_CERT_PATH
C:Usersgmlewis.boot2dockercertsboot2docker-vm

So I'm guessing we first need to go back to using set or if we require cygwin, then we put the path in single quotes to that bash doesn't try to parse it. I don't remember now if v1.2.0 typed set or export, but now that there are 3 variables, it is probably more important for us to standardize on either cmd.exe or a cygwin terminal on Windows.

@tianon
Copy link
Contributor

tianon commented Oct 31, 2014

We could likely expand on the fish shell detection and make GOOS=windows +
no SHELL set into a special case that pretends SHELL=cmd or something to
handle this.

@edmorley
Copy link
Contributor

edmorley commented Jun 7, 2015

This can be closed - it was fixed as part of #356 - where single quotes were added around the value assigned to DOCKER_CERT_PATH, which prevents the backslashes from being stripped out:

boot2docker-cli/cmds.go

Lines 266 to 271 in 17e0cec

if runtime.GOOS == "windows" && isUnixShellOnWindows() {
// Surround Windows-style paths with single quotes in exported path otherwise
// bash swallows the backslashes in export statements like:
// export DOCKER_CERT_PATH=C:\Users\ahmet\.boot2docker\certs\boot2docker-vm
out["DOCKER_CERT_PATH"] = fmt.Sprintf("'%s'", out["DOCKER_CERT_PATH"])
}

@tianon
Copy link
Contributor

tianon commented Feb 26, 2018

Sorry, this repository is long-since deprecated in favor of Docker Toolbox (whose usage is now also discouraged in favor of Docker for Windows and Docker for Mac).

@tianon tianon closed this as completed Feb 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants