Hybrid swarm - bind mounting from a windows node works with compose but fails with swarm
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.7k
- Forks
- 676
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 6
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the difference between docker compose and docker stack deploy with a Windows service using the X:/foo bind mount on the Windows leader, then inspect the invalid bind mount error and Windows path handling. Done means the stack-deployed Windows container accepts the existing host share path and starts successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, docker, docker-compose
- Domain
- devops, distributed-systems, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100