Docker Community Forums

Share and learn in the Docker community.

Docker 1.12 Swarm, services and NFS volumes


I’m unable to get a NFS volume mounted for a Docker Swarm, and cant find proper official documentation regarding the --mount syntax (

I have tried basically this command line to create a demo busybox service with a /kkk directory mounted to an NFS volume:

docker service create --mount type=volume,src=vol_name,volume-driver=local,dst=/kkk,volume-opt=type=nfs,volume-opt=device= --name test busybox

The container gets created in a random node of the swarm, but never gets in running state.

“docker service ps test” shows an error like “starting container failed: inâ|”, but as it is truncated I cant really know wheres the problem. In fact, seems that the swarm tries to spanw the instance recurrently when it detects that it is not in the desired running state.

Which is the proper syntax to mount an NFS volume at service creation time?

Thank you.

I had a similar problem and here is how I solved it.