Trying to bind a file using docker-compose file the following error occurs: invalid volume specification: '{path}': invalid mount config for type "bind": source path must be a directory
Is there a chance that the issue resolved for Windows Server 2019 with new versions of docker?
Was it really {path} in the error message or you replaced it? It probably doesn’t matter as it seems you can’t bind mount fodlers on Windows to Windows containers even though it is supported to Linux containers.
The following examples fails when using Windows-based containers, as the destination of a volume or bind mount inside the container must be one of: a non-existing or empty directory; or a drive other than C: . Further, the source of a bind mount must be a local directory, not a file.
With Windows containers? Since Linux containers support mounting a file, that would’t be a problem. What image are you trying to use and what was the image that worked on Windows 10?
How do you use a Linux image on a Windows Server? Linux containers need Linux hosts. On Windows, it means you need a virtual machine. Docker Desktop could help you run a Linux container, because that creates a virtual machine, but it is not supported on a Windows server, even if someone manages to install it. If you got the error message, that means you actually tried to use a Windows container image even if it was not your intention. So what is the image you are trying to use? Or is it not something you want to share?