Docker Community Forums

Share and learn in the Docker community.

Help request for mapping windows drives on my Pi running Docker

Guidance appreciated on best way to have a persistent mapping of a windows drive (Windows 10 PC having external USB storage drive with R/W permission for ‘Everyone’) onto my Pi running Docker?
I’d like to have the programs/containers in Dockers be able to access the Windows drives.

Thanks a bunch
avid newbie

You could use the smbclient command (part of the Samba package) to access the SMB/CIFS server from within the Docker container without mounting it, in the same way that you might use curl to download or upload a file.

There is a question on StackExchange Unix that deals with this, but in short:

smbclient //server/share -c ‘cd /path/to/file; put myfile’
For multiple files there is the -T option which can create or extract .tar archives, however this looks like it would be a two step process (one to create the .tar and then another to extract it locally). I’m not sure whether you could use a pipe to do it in one step.