Docker Community Forums

Share and learn in the Docker community.

How create volume share with docker service?

i need this command for create and apache service container in swarm

docker service create --name apache_proxy_service -p 80:80 -p 443:443 --mount type=volume,dst=/opt/proxy-conf,volume-driver=local,volume-opt=type=nfs,“volume-opt=o=nfsvers=4,addr=172.17.0.1”,volume-opt=device=:/opt/proxy-conf -d diouxx/apache-proxy

opt/proxy-conf is my dir host with have file .conf to share to container

but when i create the replicas have this error

docker service update --replicas=1 apache_proxy_service

apache_proxy_service
overall progress: 0 out of 1 tasks
1/1: failed to mount local volume: mount :/opt/proxy-conf:/var/lib/docker/volum…
^COperation continuing in background.
Use docker service ps apache_proxy_service to check progress.