Interview Prep/Docker/Volumes, storage and data

A volume driver for NFS is required for a Swarm service.

AdvancedScenarioVolumes, storage and data
Answer

Situation read → Tasks can land on any node, so data must be reachable everywhere.

What I'd do → Use the built-in local driver with NFS options:

docker volume create --driver local \
  --opt type=nfs --opt o=addr=10.0.0.5,rw,nfsvers=4 \
  --opt device=:/exports/app shared-data

In a stack file define the volume with driver_opts.

Why → The mount happens on whichever node runs the task.

Interview tip → Mention that NFS adds latency and a single point of failure; databases should not live there without care.

All Docker questions Roadmap: Docker & containers

More on Volumes, storage and data