Docker Community Forums

Share and learn in the Docker community.

How to specify binpack/random strategy

Hello everyone,

I was wondering if there is a way I could change the default spread strategy to binpack/random while creating some services on nodes.
This is how I tried but it didn’t work.

docker service create swarm manage --strategy binpack -p 4000:80 --name myhello imgName

It gets stuck in a loop.
Error: overall progress: 0 out of 1 tasks
1/1: ready [======================================> ]
verify: Detected task failure

The answer to this question will be very helpful to me because I have to implement a custom scheduler strategy at later stage and I would want that to specify while creating services.
Can someone please help me?
Thanks in advance.