I’ve got Docker 1.12.0 installed on all of my nodes. I like the fact that swarm is integrated now. I built the swarm with one command per node. Now I’ve got a swarm with 5 workers and 2 managers. I’d like to run some services on the workers but am lost on how to do that. Here’s what I’ve got so far:
docker swarm init — create swarm
docker swarm join — join swarm
docker node ls — lists nodes
docker node ps $node — show running containers on a node ??
docker run – runs on the master
Here’s where I’m lost:
docker run --name some-nginx -v /devel/nginx:/user/share/nginx/html:ro -d -e constraint:node==pi1 nginx
I would assume that the above command would run nginx on pi1…unless it couldn’t in which case it would error out ??. Howerver, all this command does is run it on the master.
How can I start a container on a worker node with the “new” Docker swarm?