Docker Community Forums

Share and learn in the Docker community.

Custom Swarm Strategy

docker

(Kylesoskin) #1

Is there a way to make it so that the swarm tries all nodes before pulling an image? For example, we have a SLES node in the cluster that has SLES containers. SLES containers cannot be pulled on other nodes that are not SLES nodes. So instead of it trying to pull an image it doesn’t have on a node, I’d rather it move on to the next node to see if that node has the image, only pulling an image when all nodes have been checked for the image.

I know I can do something like docker run -e constraint:os==sles ... to make sure it starts on the right server but I would rather not have to decide which node to run on each time I go to start a container.

I would rather find a way to do docker run some image, and the swarm figures out which node has this image, and start the container on that node.