docker / machine

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

Env swarm parameter lost on the eval help message #1289

Closed jrottenberg closed 8 years ago

jrottenberg commented 9 years ago

The helper for the docker-machine env command is not consistent with the parameters passed :

$ docker-machine env --swarm swarm-master
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.110:3376"
export DOCKER_CERT_PATH="~/.docker/machine/machines/swarm-master"
export DOCKER_MACHINE_NAME="swarm-master"
# Run this command to configure your shell:
# eval "$(docker-machine env swarm-master)"

Note : it doesn't say

eval "$(docker-machine env --swarm swarm-master)"

So running that eval command will get me to the docker api of the swarm master, not exactly what I want.

See the port :

$ docker-machine env swarm-master|grep DOCKER_HOST
export DOCKER_HOST="tcp://192.168.99.110:2376"
$ docker-machine env --swarm swarm-master|grep DOCKER_HOST
export DOCKER_HOST="tcp://192.168.99.110:3376"
nathanleclaire commented 9 years ago

Yeah this should probably be consistent for the release. cc @ehazlett

ghost commented 9 years ago

Swarm is working on dynamic master election among other features for fault tolerant cluster so how will that be reflected with machine?

aperepel commented 9 years ago

Just confirming this is an issue with the current dev release docker-machine version 0.3.0-dev (fec8b4a).

The env command output suggestion must include --swarm option if one was provided to docker-machine env, and omit it otherwise. Right now it will suggest to copy/paste an incorrect eval command which will not configure client for swarm-master properly.

nathanleclaire commented 9 years ago

Swarm is working on dynamic master election among other features for fault tolerant cluster so how will that be reflected with machine?

Basically, we're going to have to decouple the swarm name from the swarm master -- there's bit too many assumptions flying right now.

aperepel commented 9 years ago

Basically, we're going to have to decouple the swarm name from the swarm master -- there's bit too many assumptions flying right now.

I understand. Do you know planned timeframes for when swarm ha/failover is expected? I figured this trivial issue could be fixed quickly while there's a big ticket item coming in the future.

ehazlett commented 9 years ago

@aperepel the mechanics in Swarm are still being created / decided. Currently it's an experimental feature and requires specific discovery systems. Support for it won't come in this release.

aperepel commented 9 years ago

@ehazlett no problem. Regarding discovery systems and bootstrapping swarm, maybe a shameless plug is due :) Take a look if that gives you some ideas https://github.com/sequenceiq/munchausen

nathanleclaire commented 9 years ago

Ah, very interesting plug @aperepel - you might be interested in joining the discussion around "hooks" / automatically starting containers on hosts in the 0.4.0 roadmap PR.

aperepel commented 9 years ago

I've added some more fixes in https://github.com/docker/machine/pull/1339 to take care of the post-create help message too.

dgageot commented 8 years ago

Fixed with https://github.com/docker/machine/pull/2027