I’m not sure what happened but I found a way to make it work but I already tested that last week and I could have sworn it did not work at the time.
I will give my setup so should anyone need the same type of setup/access then this will be a head start for that.
On the Host docker server you mount the remote share you want to access:
# Create the mount-point (folder), this will be your access point in filesystem usage
# Now mount the share
mount -t cifs -o username=<username>,password=<password>,iocharset=utf8,file_mode=0777,dir_mode=0777 //<IP of the remote server></path to the remote share> <mountname>
#Example how I did it:
#mount -t cifs -o username=MyName,password=MyPassword,iocharset=utf8,file_mode=0777,dir_mode=0777 //126.96.36.199/internal /mnt/shield/
#Note: pay attention that there is a speace between "</path to the remote share>" and "<mountname>"
# Test the mount/share
ls -l /mnt/shield
In your docker compose file you ‘bind’ mount the volume, this is a little bit different then a normal volume command in the compose file:
# Normal Volume mount, this one exposes the 'root' folder to the host folder system so you have a persistent PSU folder
# This Volume will be mounted via 'bind' as the mounted folder hosted on the docker host is not a typical normal folder but itself is a redirection to the remote server where the actual folder is located
- type: bind
You will now have access to the folders and files on that remote server.
Here is an overview of how things are connected:
Servers and Applications involved:
Docker Host Alpine (DHA)
Remote Media Server (RMS)
PSU Container Server (PCS)
DHA mounts a shared folder located on RMS
DHA has a compose file that maps this DHA mounted folder via a ‘bind’ command
PCS has access on SSH level, i.e. SSH into container and list all files from ‘/shield’
PCS as an application can also ‘see’ all files as listed in folder ‘/shield’
This should roughly tell you how to configure and work with remote shared folders on a docker host and the containers running on top of it.