docker / machine

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

Using env command with --swarm parameter don't find 1.12 mode swarm master #3802

Closed adomenech73 closed 7 years ago

adomenech73 commented 7 years ago

I created a swarm cluster using 1.12 mode (docker swarm init & successive swarm join's) But when I try to launch env command with --swarm parameter over the master host I get the following error:

> docker-machine env --swarm pine64-1

Error checking TLS connection: "pine64-1" is not a swarm master. The --swarm flag is intended for use with swarm masters

I'm not sure if it can be because I didn't create the swarm cluster directly from docker-machine. Can anyone contrast that point ?

> docker-machine --version
docker-machine version 0.8.1, build 41b3b25

> docker $(docker-machine config pine64-1) --version
Docker version 1.12.1, build 23cf638

> docker $(docker-machine config pine64-1) infoContainers: 3
 Running: 2
 Paused: 0
 Stopped: 1
Images: 37
Server Version: 1.12.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 28
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: host bridge overlay null
Swarm: active
 NodeID: bcjnzcns9ioise48siya4hh9e
 Is Manager: true
 ClusterID: 3aop8nyj79uk9h8hr0koqzg67
 Managers: 1
 Nodes: 5
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Heartbeat Tick: 1
  Election Tick: 3
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
 Node Address: 192.168.1.145
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 3.10.102-2-pine64-longsleep
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 1.942 GiB
Name: pine64-1
ID: T2CV:GTUE:ZCFB:UZHQ:S6ER:DZDQ:YLLO:7PWN:UMB6:MJAH:U764:IFJA
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: adomenech73
Registry: https://index.docker.io/v1/
Labels:
 provider=generic
Insecure Registries:
 127.0.0.0/8
nathanleclaire commented 7 years ago

Thanks for the issue -- --swarm is a swarm legacy (i.e., not the 1.12 "swarm mode") feature

nathanleclaire commented 7 years ago

You can simply point the env at that host and run manager commands such as service -- no need for a special --swarm flag

adomenech73 commented 7 years ago

Thanks @nathanleclaire . only I have a specific doubt about if you can clear for me. Is there any way I can use compose over the swarm cluster without swarm legacy?

nathanleclaire commented 7 years ago

@adomenech73 As far as I know, Compose today will not create Swarm mode services. You must use docker service directly.

However you can docker-compose bundle to create a "DAB" which you can docker deploy (this is still highly experimental).

adomenech73 commented 7 years ago

That's great to play while we wait for new functionalities. Thanks again, you really cleared for me very quick!!

nathanleclaire commented 7 years ago

👍