A Simple Docker image to automate mounting a remote CIFS share into the Docker host.
docker run -d \
--privileged --pid=host \
--restart=unless-stopped \
-e SERVER=//server/cifsdir \
-e MOUNT=/mnt/folder \
-e OPTIONS=username=user,password=Password,file_mode=0777,dir_mode=0777 \
thisrepo
- SERVER : the remote CIFS share
- MOUNT : local host folder used for the mounting
and then to use it inside a container
docker run --rm -v /mnt/folder:/data alpine ls /data
It support all Docker platforms that use the Moby Linux.
- Docker for Mac (untested)
- Docker for AWS
- Docker for Windows
- Should work on any Alpine docker host
nsenter to access the host namespace
mount the CIFS on the hostusing the -e MOUNT env from the run command
inotifywait to output logs for any folder changes
I forked this from vipconsoluting in order to make a Windows client happy with a Synology NAS