docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.96k forks source link

Docker machine tlsverify flag misses value #2257

Closed bergtwvd closed 8 years ago

bergtwvd commented 8 years ago

On Windows 7 I installed Docker Toolbox 1.9.0b and ran through the multi-host networking example.

Step 1: docker-machine create -d virtualbox mh-keystore OK

Step 2: docker $(docker-machine config mh-keystore) run -d -p "8500:8500" -h "consul" progrium/consul -server -bootstrap

docker client complains about --tlsverify flag:

PS C:\Users\bergtwvd> docker $(docker-machine config mh-keystore) run -d -p "8500:8500" -h "consul" progrium/consul -ser ver -bootstrap flag provided but not defined: --tlsverify --tlscacert See 'C:\Program Files\Docker Toolbox\docker.exe --help'. PS C:\Users\bergtwvd> PS C:\Users\bergtwvd> echo $(docker-machine config mh-keystore) --tlsverify --tlscacert="C:\Users\bergtwvd.docker\machine\certs\ca.pem" --tlscert="C:\Users\bergtwvd.docker\ \machine\certs\cert.pem" --tlskey="C:\Users\bergtwvd.docker\machine\certs\key.pem" -H=tcp://192.168.99.100:237 6 PS C:\Users\bergtwvd>

When I set --tlsverify==true it works:

docker --tlsverify=true --tlscacert="C:\Users\bergtwvd.docker\machine\certs\ca.pem" --tlscert="C:\Users\bergtwvd.docker\machine\certs\cert.pem" --tlskey="C:\Users\bergtwvd.docker\machine\certs\key.pem" -H=tcp://192.168.99.100:2376 run -d -p "8500:8500" -h "consul" progrium/consul -server -bootstrap

nathanleclaire commented 8 years ago

Hm, sounds like a Docker client issue. @ahmetalpbalkan are you aware of any issue like this with the Windows client?

ahmetb commented 8 years ago

Hmm I can repro and it's totally weird, I wonder why nobody has noticed this before.

It looks like:

My first guess is there's something wrong with docker/pkg/mflag on Windows and we should investigate it on docker repo. @bergtwvd can you please open an issue with these findings at https://github.com/docker/docker/issues/new ? I'll be busy next few days prepping for my DockerCon presentation but somebody may figure out what's going on in the meanwhile.

nathanleclaire commented 8 years ago

Thanks for looking into it @ahmetalpbalkan. This seems to be a Docker client behavior issue, so I'm going to close this issue.

aperepel commented 8 years ago

I noticed the config command output values each on a new line, could it be the reason? any special treatment or \ to be added in the output maybe?

01:36:06::docker-nifi ♨ >  docker-machine config keystore
--tlsverify
--tlscacert="/Users/agrande/.docker/machine/certs/ca.pem"
--tlscert="/Users/agrande/.docker/machine/certs/cert.pem"
--tlskey="/Users/agrande/.docker/machine/certs/key.pem"
-H=tcp://192.168.99.100:2376

The error suggests it may not be reading all of the config values from the command because of this:

Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env keystore
flag provided but not defined: --tlsverify
--tlscacert
nathanleclaire commented 8 years ago

@aperepel It might not work in some shells, but works fine in bash and zsh for me.

aperepel commented 8 years ago

Thanks, @nathanleclaire . Nothing has changed for me since November 2015, same mac, same bash. This script fails at the line: https://github.com/aperepel/docker-nifi/blob/master/bootstrap_vms.sh#L24

The only change was a docker & docker-machine upgrade. Should we reopen?

aperepel commented 8 years ago

I noticed that if I remove double-quotes, it works again. Go figure, subtle change, but lots of repercussions. I did add them as per shelllint's best practices.