I am using Docker version 17.12.1-ce.
I have set up a swarm with two nodes, and I have a stack running on the manager, while I am to instantiate new nodes on the worker (not within a service, but as stand-alone containers).
So far I have been unable to find a way to instantiate containers on the worker specifically, and/or to verify that the new container actually got deployed on the worker.
I have read the answer to this question which led me to run containers with the -e
option specifying constraint:Role==worker
, constraint:node==<nodeId>
or constraint:<custom label>==<value>
, and this github issue from 2016 showing the docker info
command outputting just the information I would need (i.e. how many containers are on each node at any given time), however I am not sure if this is a feature of the stand-alone swarm, since docker info
only the number of nodes, but no detailed info for each node. I have also tried with docker -D info
.
Specifically, I need to:
- Manually specify which node to deploy a stand-alone container to (i.e. not related to a service).
- Check that a container is running on a specific swarm node, or check how many containers are running on a node.