Docker mounted volume adds ;C to end of windows path when translating from linux style path

So with some extra digging I found these three threads, related to git-bash mucking up docker mount:

https://forums.docker.com/t/weird-error-under-git-bash-msys-solved/9210
https://github.com/moby/moby/issues/24029#issuecomment-250412919

When I look up mingw’s documentation on the path conversion git-bash is using, I find this table of syntax:
http://www.mingw.org/wiki/Posix_path_conversion

One of which outputs in the format: x;x;C:\MinGW\msys\1.0\x. Note the ;C in it. If git-bash is trying to be clever, stuffing up the syntax and outputting a path with this format, this would explain it.

Solution is to escape the path conversion, using by prefixing with /. So the working docker command to run docker from git-bash with present working directory:

docker run -it --rm -v /${PWD}:/wkDir $IMAGE_TAG yarn dev

Leave a Comment