Docker Community Forums

Share and learn in the Docker community.

What "strategy" will be used to distribute containers by default


(Ralph Kincade) #1

I know if I run the command

sudo docker run -d -P swarm manage token://$(cat swarmtoken) --strategy binpack

this will result in a binpack strategy for creating containers , but what if i just run

sudo docker run -d -P swarm manage token://$(cat swarmtoken)

what happens by default ???

thanks!!!


(Sabin Basyal) #2

By default the --strategy used is spread.
So, if you do not specify --strategy binpack, the default --strategy spread gets applied.


(Tchakoute) #3

that’s the way how it works when using the token discovery. Do you know how to set the binpack strategy in the key-value discovery ? (when setting a cluster with: docker swarm init).

Thx in advance