Connect to SMB/CIFS share using Docker Volume
Create the Volume
In order to connect containers to our SMB share that contains all of our media files, we have to create a docker volume.
I'm choosing docker volume over mounting the share through fstab on the host because it's simpler to create using docker abstraction and your compose files are not dependant of the path you mounted the share if you move your containers to another OS.
The command is fairly simple :
Make sure you don't have any comma in your password or username
Connect to the Volume
Inside the compose file of your app, you can add the volume as external and then use it as a normal volume.
Here's an exemple with the xyz service :
You now have access to your SMB/CIFS share inside your containers !
Last updated