I'm trying to bind mount a network drive from my host (Windows 10) to a local folder in a container but, regrettably, I haven't been able to achieve it.
In Linux I've had no issues whatsoever.
Any help would be greatly appreciated :)
docker run -v G:/:mnt/shared ubuntu /bin/bash
For local drive, use the following command:
docker run -v c:/your-directory/:/mnt/shared ubuntu /bin/bash
For network drive, you need to create a Docker volume pointing to that network drive.
The command would be as follows:
docker volume create --driver local --opt type=cifs --opt device=//networkdrive-ip/Folder --opt o=user=yourusername,domain=yourdomain,password=yourpassword mydockervolume
docker run -v mydockervolume:/data alpine ls /data
Reference is here: How to Add Network Drive as Volume in Docker on Windows
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With