Completely lost with network share between TrueNAS Scale and Docker/Portainer in a VM.
I've been working on solving this for the last few days to no luck. Hoping someone can point out where I'm going wrong.
Right now I have TrueNAS Scale running on the bare metal of my server with a few datasets shared. I am able to access those datasets from my Windows PC.
In TN I have a VM running Ubuntu Server with Docker and Portainer installed.
Steps I have taken so far:
- Create dataset in TN, edit user permissions, enable SMB and NFS shares.
- Create bridge so VM and host can talk to each other. Able to ping between the two.
- Add Volume in Portainer following the instructions from this comment.
- Name: Vol1
- Local Driver
- Use CIFS Volume
- 192.xxx.x.x
- /tank/downloads
- User: {user} (Same user I use to access the folder in Windows)
- Password: {password} (Same password I use to access the folder in Windows)
The problem (I think) is Portainer shows the mount point as /var/lib/docker/volumes/{folder name}/_data which seems to me to be mounting inside the VM disk, not accessing the network share. When I cd into that folder none of the expected contents are there.
Any insight would be greatly appreciated.
Posted Sep 8, 2023, 3:51 PM UTC
Dont use SMB/CIFS unless you absolutely have to, usually when Windows is involved.
Use a NFS share from TN and add that as a Docker volume, Docker natively can handle NFS. Then mount that volume to whatever containers you want. Of course you need to make sure that permissions are done correctly.
For the NFS Volume settings would it be:
?
Using those options I end up with the same mount point as above: /var/lib/docker/volumes/Vol1/_data and still show no files in the terminal.
Looks alright but i cant say for sure, i dont use Portainer for things like this. Imo its not good to purely rely on a GUI based tool like this without knowing how Docker underneath works.
Where else would it be? That is the default path for volumes. That doesnt mean the data isnt there through the share.
You should probably ask in r/portainer and r/docker
Maybe I'm confused. Going to that folder in the terminal doesn't list any of the files from the network folder. Creating a new text file doesn't create the file in the share either.
I'll cross-post to those two. Thanks.
If the containers weren't running, the volume directories were empty until they were started.
I've just moved most of my *arr containers back off NFS volumes for their config volumes, I found performance abysmal even on 2.5g links with small collections. I think it's more to do with the sqlite DBs not liking it. I might test it at some stage with an iscsi volume in the VM