Docker accessing data from storage

mihies

Dabbler
Joined
Jan 6, 2022
Messages
32
So I'm running a docker host on alpine based VM. I wonder what's the best way to access/store data from TrueNAS.
Here is how I see it.
1. One way would be through NFS, but AFAIK that sounds unreliable because of locking issues and what not. On plus side, one can mount datasets.
2. The other way seems to be to add a disk device linked to a zvol directly to VM. This sounds more reliable, but one can't use datasets, just zvols. This can be a problem because zvols required fixed size, but I guess it could be mitigated with using Sparse option (which, I assume, uses only the space on disk that is actually in use).

I'm leaning to second option. Am I missing any other option or something?
 

chuck32

Guru
Joined
Jan 14, 2023
Messages
623
1. One way would be through NFS, but AFAIK that sounds unreliable because of locking issues and what not. On plus side, one can mount datasets.
For quick access to some docker files I bound the docker container paths to SMB shares (mainly paperless). I would think if you don't mess around too much in your shares it shouldn't break anything.
2. The other way seems to be to add a disk device linked to a zvol directly to VM. This sounds more reliable, but one can't use datasets, just zvols. This can be a problem because zvols required fixed size, but I guess it could be mitigated with using Sparse option (which, I assume, uses only the space on disk that is actually in use).
Yes sparse only takes up what is actually used. Don't overprosion your space then.

Zvols are block storage devices, I'm not sure how they would solve your problem since you can't mount / share / browse them like a dataset.
 
Top