Docker swarm Volume Mount

Hi,

In Docker certification course a section mentions about docker configs in which we can mount a file located in a single node to be accessible to the other replicas of the service in another nodes . Likewise How to mount a volume or a folder in the host system of a node for eg : /data/shared_data/ folder exists in node01 . I want this folder to be mounted to other replicas of the service running on node01 and node02 . Is it possible . If so could you please exaplain how to proceed ? If possible please provide a docker compose file to deploy a stack to test the same .

To mount a directory from a host into containers across different nodes, you can use NFS (Network File System) to share the directory among the nodes.

1 Like