Help! I'm unable to map a local working dir to container

Hi Guys,

I’m using the built-in Linux on Windows Machine, trying to directly share my source code with my container using this cmd :

docker run -d -p 5001:3000 -v $(pwd):/app react-app

Note: pwd = source code path, /app is the directory in container

I am getting error :

docker: invalid reference format.
See 'docker run --help'.

Does anyone know the reason error? Any suggestions

Reference : Ultimate Docker Chapter 5 video 11

If your source code path has a space in it, you’ll need to quote it, otherwise docker will try to use everything after the space as the image name, which won’t work.

docker run -d -p 5001:3000 -v "$(pwd)":/app react-app

@sachin4589 if you’re using powershell terminals, either inside VSCode or outside try using curly braces as an alternative

docker run -d -p 5001:3000 -v ${pwd}:/app react-app

P.S. looks like this has already been covered here Using docker run with $(pwd) on Windows/Powershell - Docker - Code with Mosh Forum

On windows a use Git Bash with
docker run -d -e WATCHPACK_POLLING=true -p 5001:3000 -v $(pwd -W):/app react-app

-e WATCHPACK_POLLING=true => solved the Hot Reload issue
$(pwd -W), on windows to get the current folder correctly