Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mounting Win10 directory that has spaces and dashes in the path into Ubuntu Docker Container

I am trying to mount a Windows 10 directory into an Ubuntu container on docker. The path has spaces and a dash in the name:

C:\Users\eko\OneDrive - MyCo, Inc\_Git\covid19-maps

When I run the following in PowerShell:

docker run -i -v C:/Users/eko/OneDrive\ -\ MyCo,\ Inc/_Git/covid19:/home/covid19 ubuntu:latest

Docker fails with unknown shorthand flag: '\\' in -\

I also tried escaping the dash with a backslash like so /OneDrive\ \-\ MyCo,\ Inc/_Git but that also fails.

like image 281
eko Avatar asked Sep 14 '25 23:09

eko


1 Answers

Ok - not exactly an answer to the question, but having the git repo in OneDrive was redundant.

I moved it to a less problematic path and it worked.

docker run -i -v C:/_git/covid19:/home/git/covid19 ubuntu:latest
like image 97
eko Avatar answered Sep 16 '25 13:09

eko