DEV Community

Discussion on: How to run docker on Windows without Docker Desktop

Collapse
 
jvmlet profile image
Furer Alexander

Thanks Nicolas. Have you managed to mount volumes from windows to docker image running in WSL2 ? Looks like windows folder has to be mounted first to WLS2 and then from WSL2 to the docker image ....

Collapse
 
herbatnik profile image
Marek Kreśnicki

It's easy, by default (at least for me) wsl has mounted all drives in /mnt// for example /mnt/c/ for C: Drive and /mnt/d/ for D: drive
From there you can simply use these paths as youve mentioned

Collapse
 
jvmlet profile image
Furer Alexander

yes, you are right... but.
Previously with Docker Desktop we could run docker with -v %cd%/someFolder:/whatever or -v ./someFolder:/whatever, now we have to provide full path , like -v /mnt/c/full/local/path/to/someFolder:/whatever , which is user specific and will not run on team mate's computer... Any thoughts how to overcome this ?

Collapse
 
_nicolas_louis_ profile image
Nicolas Louis

When windows folders are mounted and you launch a terminal to your WSL2 distro, you can navigate on your windows folders with commands like : wsl cd MyWindowsDirectory... wsl ls etc... without to be connected to a bash, just direcly from windows :)
When Dockerd is simply launched in your distro, you can run also "wsl docker ps" etc...