After executing this;
eval $(docker-machine env mymachine)
How do I check if the docker daemon on mymachine
is a swarm manager?
You could also use docker info
to see the result of Swarm
property (inactive
or active
).
For example:
function isSwarmNode(){
if [ "$(docker info | grep Swarm | sed 's/Swarm: //g')" == "inactive" ]; then
echo false;
else
echo true;
fi
}