How can I deploy two (or more) containers on a same node using affinity filter on docker create service?
I’ve tried the following commands but both containers get deployed on different nodes.
For 1st container:
docker service create -d -p 4000:80 --name myhello username/repo:part1
For 2nd container:
docker service create -d -p 8888:5000 --name myflask -e affinity:service==myhello username/repo:part2
docker service create -d -p 8888:5000 --name myflask -e affinity:container==‘containerNo’ username/repo:part2
Could someone possibly give me some hints or route me in the right direction ?
Thanks in anticipation.