Can't set Docker Volume for Container in Windows Docker CE

I’ve been scouring the forums and looking through a lot of posts, trying out the commands I’ve seen from other people but I do not get the results that they do. I have no idea what I’m doing run. I’ll share the link I’m getting a lot of commands from Volume mounts in windows does not work

When I run docker run -v c:/Users:/data alpine ls /data or any combination of -v … I get the errors
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: invalid bind mount spec "c:/Users:/data": invalid volume specif ication: 'c:\Users:\data'. See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.

So I cannot figure out what’s happening that’s wrong but I cannot bind any volume in so many ways I’ve tried.

Did you enable the Drive to be shared with the container by going into Settings >> Shared Drives?

I had the same problems under windows using git bash.
Try using Windows Power Shell for issuing the docker run command!

Henry

I am getting the same error using Power Shell and I checked that my C drive is shared with Docker. Any other thoughts on what could be causing this?

It’s just a syntax problem. The colon : character is already reserved as the delimiter between the host directory and guest directory when you use run -v. So you can either leave out the host drive letter and just specify the host path as /Users, or use the alternative syntax of /c/Users. Then you will only have one : character in your -v and you won’t confuse docker.

1 Like

Thanks . :slight_smile:

Hello. Thanks for your answer.

docker run -p 4443:4443 --name openvidu --rm -v /var/run/docker.sock:/var/run/docker.sock -v c:/openvidu/ -e OPENVIDU_RECORDING=true -e OPENVIDU_RECORDING_PATH=c:/openvidu/records -e OPENVIDU_WEBHOOK=true -e OPENVIDU_WEBHOOK_ENDPOINT=http://host.docker.internal:8080/hook -e OPENVIDU_SESSIONS_GARBAGE_INTERVAL=3600 -e OPENVIDU_SESSIONS_GARBAGE_THRESHOLD=3600 -e OPENVIDU_WEBHOOK_EVENTS=[“participantJoined”,“participantLeft”,“sessionCreated”,“sessionDestroyed”] -e OPENVIDU_WEBHOOK_HEADERS="[“Authorization: Bearer TOKEN”]" openvidu/openvidu-server-kms:2.15.0

my docker commend is above.

I try run in windows containers this docker commend.

How should update this commend.?