I have 2 service supposed to run on a machine that i add to my Swarm (Docker), serviceG and serviceR, serviceG is in global mode, serviceR is in replicated mode.
When i add a new machine to docker swarm, the image of serviceG is automatically pulled, however the image of serviceR is not automatically pulled.
If i remove one container of serviceR on other machine, image is pulled on my new machine and then container can now be launch on new machine.
Images are both stored on the same repository.
I can use Docker Pull when machine start but i'd like the pull to be automatically done when new machine join swarm for image of service R.
This is functioning as designed. Swarm mode does not prematurely rebalance workloads in the swarm. Doing so could result in workloads rescheduled onto a flapping or otherwise malfunctioning node and generally results in reducing the availability of the service.
If you need to manually force a rolling update to rebalance your service, you can run:
docker service update --force your_service_name
If you only want to pull an image and not run it, you can log directly into the new node and run docker pull your_image_name
.