You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Bind mounts not working when using DOCKER_HOST variable for Windows Containers #12750
I am trying to start windows containers using docker compose from linux host on remote windows machine using SSH. When I run docker compose up command , remote windows host fails to run containers, since the local current path gets prepended to the volume.
Error response from daemon: invalid mount config for type "bind": invalid mount path: '/builds/projects/windows-docker/C:\Users\test-user\results' mount path must be absolute
What I have tried so far:
added platform: windows/amd64 to docker-compose.yaml
Tried Unix-like path //C/Users//results (not working, although compose client stops adding current path to the volume name)
Tried to add a slash in front of the path /C:\Users<YourUserName>\results (not working, remote windows machine complains that the path must be absolute)
Steps To Reproduce
Set DOCKER_HOST variable to ssh://user@windows-host/
Yes this is a regression which was probably introduced with #12725. Also Named Pipe mounts do not work as before:
validating docker-compose.yml: services.node.volumes.1.type services.node.volumes.1.type must be one of the following: "bind", "volume", "tmpfs", "cluster", "image"
I downgraded to Docker Compose version v2.31.0 (last stable Alpine version) and it's working again (previously I had the packages from "edge" installed).
Thanks for the help!
Do you think instead of guessing, it is possible to rely on platform: field inside of the service description? This seems very logical to me. If a user explicitly defines the platform as windows/amd64 , then windows path can be expected, and if it is not windows - then there is no need to check for windows paths.
Activity
fabiang commentedon Apr 17, 2025
Yes this is a regression which was probably introduced with #12725. Also Named Pipe mounts do not work as before:
My Compose file:
I downgraded to Docker Compose version v2.31.0 (last stable Alpine version) and it's working again (previously I had the packages from "edge" installed).
perosb commentedon Apr 18, 2025
Same here with npipe.
2.35.0 breaks npipe which works fine in 2.34.0
ndeloof commentedon Apr 26, 2025
named pipe support has been restored by compose-spec/compose-go#771
original issue is that compose doesn't guess a Windows source path is absolute when running on Linux. This is a pretty uncommon scenario, actually codebase tries to detect the opposite: target unix absolute path when running on Windows, which is a common case (Docker Desktop Windows), see https://github.com/compose-spec/compose-go/blob/ca961cc58145b2b1b8221f2a0c4e9734772156fc/paths/unix.go#L26
0xff8 commentedon Apr 28, 2025
Hi @ndeloof ,
Thanks for the help!
Do you think instead of guessing, it is possible to rely on
platform:field inside of the service description? This seems very logical to me. If a user explicitly defines the platform aswindows/amd64, then windows path can be expected, and if it is not windows - then there is no need to check for windows paths.