swarmkit icon indicating copy to clipboard operation
swarmkit copied to clipboard

Hybrid swarm - bind mounting from a windows node works with compose but fails with swarm

Open dazinator opened this issue 2 years ago • 0 comments

I have 3 nodes, 2 linux plus one windows all in a swarm. On the windows node (which is also the leader) I have an SMB / CIFS file share (azure file share) mapped as a network drive on path X:/ In my compose file I have a service which is based on a windows image, and has a bind mount from the windows host X:/foo into the container. I can run this with docker compose successfully. However when I use docker stack deploy (ensuring the service is placed on this windows host) and then inspect the logs, the container fails to come up becuase docker complains its in invalid bind mount because the source directory X:/foo does not exist. It doesn't matter what variations of the path format I try, different casing, with or without the slash, with or without the colon, different slash directions etc.

However for a service based on a linux image that bind mounts from /x`` on a linux host, where /xhas been added to the linux host as a file share, I am able to successfullydocker stack deploy` that service ensuring its placed on the linux host. So this issue is with windows hosts and windows paths only.

This is show stopper because the windows container needs access to the file share. docker volume create on windows platform does not let you use options to its also impossible to create a cifs volume for the file share on windows.

dazinator avatar Sep 14 '21 10:09 dazinator