Docker -v flag doesn't link local/host to container

So I’m having this strange problem, where I do run the docker with the -v flag to link local folder to the container folder of the code, but no update happens when I update the local code, no matter what I do. So this is the second tutorial I’m watching for Docker, it teaches about using the -v to link in some way the local code with the container code, running the code below:

docker run -p 5173:5173 -v “$(pwd):/app” -v /app/node_modules react-docker

But it simply doesn’t work. Why is that and what am I supposed to actually to do to make this thing work?

If by any chance it’s relevant, I’m in a Windows 11 computer using Bash terminal.

Just figured out what was the problem. The lack of a blessed “/” before the $(pwd) made everything not work as it should. So if you’re using a Bash terminal on windows, remember to write -v /$(pwd):/app or else you will waste a lot of your time with this hell of a thing called Docker.

Hello

For info, I’m working with W11 and WSL2, my Linux distribution is Ubuntu and I never use the leading / by, just, a single . (dot) or $PWD or $(pwd) and the three notations are working for me.

None of these work for me. Docker requires a absolute path to be put when referring to the host, so just a dot doesn’t work, and the other two does the same thing, linking to a unrelated folder where nothing exists and the container runs as it hasn’t a volume.

For some reason though, using the / doesn’t work the same way it does in the videos I watch. For example, when trying to run a web project with vite, it says it doesn’t find vite, so I end up needing to install it in the host, but even after I do it, it throws errors about not having a linux dependency or something making it impossible to run a vite project in a container with a mapped volume…