I just tried to create a simple swarm setup with a master and a node on Digitalocean.
docker-machine create --driver=digitalocean --digitalocean-access-token=<access> --swarm --swarm-master --swarm-discovery=token://<token> master
docker-machine create --driver=digitalocean --digitalocean-access-token=<access> --swarm --swarm-discovery=token://<token> node1
The machines are created successfully and I'm able to connect to them. But when I do a docker info
on the master, it doesn't show the swarm node:
~ eval "$(docker-machine env master)"
~ docker info
Containers: 2
Running: 2
Paused: 0
Stopped: 0
Images: 1
Server Version: 1.11.0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 12
Dirperm1 Supported: true
Logging Driver: json-file
Plugins:
Volume: local
Network: bridge null host
Kernel Version: 4.2.0-27-generic
Operating System: Ubuntu 15.10
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 488.9 MiB
Name: master
ID: NF6T:HU46:7MMC:FE6W:AECZ:SSPN:PVBG:YDES:QJ2A:65HB:4FBT:H6LU
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Labels:
provider=digitalocean
However, I am able to see both the machines in the swarm using:
docker run --rm swarm list token://<token>
To verify this, I repeated the same process using the Virtualbox provider, and couldn't see the node there as well.
Version info:
$ docker --version
Docker version 1.10.3, build 20f81dd
$ docker-machine --version
docker-machine version 0.7.0, build a650a40
$ docker run --rm swarm --version
swarm version 1.2.0 (a6c1f14)
Am I doing something wrong, or is this a bug?
Very close. You want eval $(docker-machine env --swarm master)
(note the --swarm
flag). Since you might want to access the instance directly, you have to specify explicitly you want to configure the client to talk to Swarm.
Oops, don't know how I missed that out. Works fine now, thanks!
Most helpful comment
Oops, don't know how I missed that out. Works fine now, thanks!