Docker windows sharing source code only partially working

Hi I have a minor windows related error where when I want to execute:

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

it throws the following error:
`````docker: Error response from daemon: create (pwd): "(pwd)" includes invalid characters for a local volume name, only “[a-zA-Z0-9][a-zA-Z0-9_.-]” are allowed. If you intended to pass a host directory, use absolute path.
See ‘docker run --help’.

so because I am on windows I used:
docker run -d -p 5001:3000 -v %cd%:/app --name c1 react-app

which actually works and also updates the code in the container, but sadly the react app does not get updated. While the title changes in the container file, which I verified with `“cat index.html” it does not update the title in my chrome and firefox browser. I tried refreshing. It updates when I restart the container. This likely has a simple fix or maybe a workarround - so if you managed to fix it I would be glad for your help :slight_smile:

Justin

PS: I tried changing %cd% with other commands - looks like the only way is to trigger hot reload on app but no idea how

1 Like

Hi Justin,

I have the same problem in the follow lessons and I am using Windows 10:

11-Sharing the Source Code with a Container
11-Publishing Changes

I believe you will have the same problem when starts Docker Compose lessons.

I think have some relation with nodemon lib, but I didn’t found nothing yet…

Anyone knows how to solve this situation to help us?

Hello Justin,

Try this link:

I am also using Windows and this command worked for me. Just run this on Windows PowerShell.

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

Hope this helps.

Regards,
Hamza

2 Likes

still not working. I did some changes on the front end and still, it is not reflected on to the container. I tried both git-bash and powershell.