Volume in Docker Swarm

I am currently in the Docker Swarm - Docker Config Objects topic, but let’ say I want to do it using a volume.

Running a service create with volume mounting and replicas, the volume replicates to all worker nodes, no problem… however the synchronization of a file can only happen on a specific node, e.g. in the swarm node1 when modifying the file in the host can only be seen inside the container within that node1 which is fine as expected but other worker nodes cannot see the file.

I’ve read somewhere that Docker and Swarm only come with the standard local driver out of the box. It doesn’t have any awareness of Swarm, and it will just create new volumes for your data on whichever node your service tasks are scheduled on.

Probably it’s been discussed in the Docker Swarm section but I can’t seem to find it or I missed it … maybe you can shed some light on how can this be accomplished. I want to add/modify a file within a volume and replicates to every nodes … is this possible?

As you mentioned:
Docker and Swarm only come with the standard local driver out of the box. It doesn’t have any awareness of Swarm.
You want a 3rd party driver plugin that is Swarm aware,
There are lots of 3rd party volume drivers, which you can find on the Docker Store.