docker / machine

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

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

Open mgangelov opened 8 years ago

mgangelov commented 8 years ago

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!

nathanleclaire commented 8 years ago

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

mgangelov commented 8 years ago

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.

nathanleclaire commented 8 years ago

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).

mgangelov commented 8 years ago

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.