machine icon indicating copy to clipboard operation
machine copied to clipboard

What are the commands executed by docker-machine when creating a swarm

Open mgangelov opened this issue 10 years ago • 4 comments

I want to replicate adding a swarm node manually and since I haven't been able to do that yet and everything only works with docker-machine assistance, what are the exact commands that docker-machine runs when docker-machine create --swarm is called? Thank you!

mgangelov avatar Aug 22 '16 10:08 mgangelov

Take a look at the --debug output. You should see this information included

nathanleclaire avatar Aug 22 '16 18:08 nathanleclaire

It didn't really give me anything useful. This is the full log, but the relevant section is:

Configuring swarm... (master) Calling .GetIP (master) Calling .GetURL Reading CA certificate from /root/.docker/machine/certs/ca.pem Reading client certificate from /root/.docker/machine/certs/cert.pem Reading client key from /root/.docker/machine/certs/key.pem Reading CA certificate from /root/.docker/machine/certs/ca.pem Reading client certificate from /root/.docker/machine/certs/cert.pem Reading client key from /root/.docker/machine/certs/key.pem

It doesn't really show me how docker-machine deploys the swarm-agent-master (in the case of using --swarm-master) and swarm-agent containers to the host.

mgangelov avatar Aug 23 '16 09:08 mgangelov

Ah yeah, I forgot we moved to using the API directly instead of shell commands. If you take a look at docker ps of the created Swarm containers it should give you some hints. (Psst: Or you could use the new Docker 1.12 swarm mode features instead ;) -- they're not too bad to get going with).

nathanleclaire avatar Aug 23 '16 17:08 nathanleclaire

I think I might be alright with using docker inspect, but still haven't tried if what I'm doing actually works.

I am using docker-compose, so to use the swarm mode I also need to use DAB functionality and I'm not comfortable with using experimental features or having to push the images I build to the Hub.

mgangelov avatar Aug 23 '16 17:08 mgangelov