Mounting a directory to a container gets set with wrong path

I am trying to mount a directory of my host machine to a container.
The command I use for the same:

docker run --name test -v "$(pwd)":/app <image-name>

The pwd is like = /d/Docker/ProjectsWithDocker/react-frontend

But when I inspect I get (docker inspect test):

"Mounts": [
                "Type": "bind",
                "Source": "D:\\Docker\\ProjectsWithDocker\\react-frontend;C",
                "Destination": "\\Program Files\\Git\\app",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"

Note the “Source” got appended with a ;C and because of this correct directory isn’t mounted.
How do I fix this ?

Did you ever resolve this? I am having the same issue, and cannot find anything to help.

Edit: Switched over to ubuntu and my mount worked fine, seems to be an issue with Git Bash.

1 Like