«

»

Sep 07

Getting the Docker Swarm Discovery Token

At the moment, docker swarm doesn’t have a self-discovery method. If you’ve mislaid or forgotten the discovery token you can’t add new elements. It just so happens that if you do a docker inspect $SWARM_AGENT_MASTER, the token will show up in the command line arguments.

A lot of output is produced. However, the information is there. Next time remember the discovery token ;-).

Below is using docker machine to get the configuration information to connect to the master. If the container is running locally, you could just do docker inspect on the container. Otherwise you may need to specify the host with -H or use other methods.

Note the token:// argument and copy the token. Or, if feeling lazy, you could:

Leave a Reply

%d bloggers like this: