I am running Docker for Windows and WSL on Windows 10. I am part of a development team that uses Linux (except for me). I am trying to use a repo that the rest of the team uses on Linux. When I run the make command to execute the Makefile (which contains a “docker run” command), I get the following error (edited):
docker: Error response from daemon: invalid mount config for type “bind”: bind mount source path does not exist: /home/user/infrastructure
I know the path exists, because that is where I am running make from. The path is retrieved in the make file using the following:
docker run --mount type=bind,source=$(shell pwd),destination=/mnt/infrastructure
It would appear that Docker for Windows cannot access the file system in WSL, because if I move the repo from /home/user/infrastructure to /c/Users/user/infrastructure then Docker for Windows is able to mount the volume.
However, at that point I get the following error (edited):
docker: Error response from daemon: invalid mount config for type “bind”: bind mount source path does not exist: /home/user/.azure.
This is essentially the same error, just with different path in the WSL filesystem.
In order to get this to work correctly, its obvious to me that I need to get Docker for Windows to have access to the WSL filesystem, but I don’t know how. I have read many posts on how to get Docker for Windows to mount paths within the Windows filesystem, which works fine for me, but none about mounting paths in the WSL filesystem. If anyone knows how to do that, I would appreciate the help.