Docker volumes, WSL and Docker for Windows [memo]
January 25, 2018
While I’m on Windows I do use Docker for Windows. It’s running on my host machine but I’m running docker commands from WSL (Windows Linux subsystem).
While running it from there the volumes I’m trying to mount into the container won’t work.
So the solution is (assume everything you want to mount is on disk C):
sudo mkdir /c- to create a directory named
sudo mount --bind /mnt/c /c- mount existing
cd /c/path/to/project- go to the project
docker run -it -v $(pwd):/project node bash- it WORKS!
The solution has been found here - https://github.com/Microsoft/WSL/issues/1854
Feel free to contact me for feedback or questions. Find my contacts on About page.