To make an SMB network share accessible to a Docker container, first mount the SMB share on your host system, then map that mounted directory into your container as a volume.
For example, on a typical Linux host, you can mount the SMB share with:
sudo mount -t cifs //server/share /mnt/smb \
-o username=youruser,password=yourpassword,uid=$(id -u),gid=$(id -g)
Replace //server/share with your SMB path, /mnt/smb with your desired mount point, and set your credentials as needed.
Then, when running your Docker container, map the mounted directory:
docker run -v /mnt/smb:/data your-image
Or in Docker Compose:
services:
your-service:
image: your-image
volumes:
- /mnt/smb:/data
Note:
- Ensure permissions are set correctly by matching the container's user/group IDs to those used to mount the share, or set
PUID/PGIDenvironment variables if your image supports them. - Using SMB/NFS for
/configmounts is not supported by LinuxServer.io images, but is fine for general data volumes like/dataor/media. See the LinuxServer.io documentation for more details.