How can I add an existing dataset into an existing Docker container?

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
I've followed a series of videos starting here: I've created a VM, into which I've installed RancherOS. I've then used Rancher to install Docker and Portainer, and then Portainer to install qBittorrent from here (this wasn't covered in the videos, but I've followed essentially the same process as the videos showed). Everything is working at the moment, but I want to set up a monitor folder for qBittorrent to watch and I'm not having any luck.

I want to use a folder which already exists in a different dataset to all of the above (specifically, one I created to use with NextCloud). The relevant FreeNAS details are:

Pool: volume_1
Dataset: Cloud
Path to the watch folder: Cloud/Neil/Documents/qBittorrentWatchFolder

I thought that since the watch folder sits in an existing Samba shared folder, I'd just be able to use a network path to specify it, but I don't know how to specify the path or whether SMB shares are accessible in FreeBSD/Docker or if it would need to be an NFS share instead.

I've also tried creating a new NFS share in FreeNAS with the path "/mnt/volume_1/Cloud/Neil/Documents/qBittorrentWatchFolder": I've then added a new line to the rancheros-cloud-config.yml file, under "volumes:"

- /mnt/nfs-2:/mnt/nfs-2:shared

(This line was identical to the line above it, with "1" changed to "2".)

Having restarted the VM and logged in using SSH, I was able to confirm that the new mount was visible, but as an empty folder. Files which I had placed in the folder were not visible to the VM, and files I created in that folder from within the VM were not visible from outside of it. I don't know where the files I created in the VM were actually stored, even.

Can anyone tell me where I'm going wrong? How can I make the existing folder visible to the qBittorrent Docker image, with read/write permissions to it?

Thanks in advance.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
RancherOS provides a nice set of GUI-based configuration. You need to follow one of the steps to set up both a rancher server and at least one "cattle" host to run your workloads.

From the Rancher Server, you can install a driver (under the catalog menu) called Rancher-nfs. (not exactly the same thing as just using nfs in your docker run).

Once you do that, all of your containers can be set to have volumes based on a rancher-nfs volume (basically equals one subdirectory of the NFS root you share to the rancher NFS driver).

It works really well, but perhaps if you will use it for many different kinds of container (particularly media) you will want to think carefully about your design if all of your containers will work out of one single NFS share.

The syntax for your volume will be mostly OK if you specify rancher-nfs at the bottom, but substitute shared for rw (all access is shared)

Assuming you create a rancher-nfs volume called qbittorrent

qbittorrent:/mnt/nfs-2:rw
 

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
Thanks for the response.

I'm having trouble getting to the Rancher UI (assuming it was actually installed). The internet tells me it should be on port 8080, but that's already in use by qBittorrent: I've tried shutting qBit's container down on the assumption that Rancher would then be able to respond on that port, but it still doesn't. Changing qBit's port in its options (to 8090) didn't make any difference either, with or without restarting the app and/or its container: it still responds to 8080, not 8090, no matter what its settings say. Using Portainer to change the port on the qBit container itself is similarly unsuccessful, although it does prevent qBit from responding at all until I change it back, whether or not the settings in qBit are updated to match the new port in Portainer.

How can I check/change the port that Rancher's using?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702

NJMorf

Explorer
Joined
Aug 9, 2017
Messages
53
Thanks for the advice. However...

I installed the latest update to FreeNAS tonight and when it (finally, after longer than I expected) came back up, I no longer had a VM or any of the shares I'd added when setting up the VM. I tried restoring the config backup taken immediately before the patch, but after another surprisingly long wait I still didn't have the VM or the shares. I do still have the VM's dataset, so I suspect I can somehow restore what was lost, but I'm too tired to try it tonight, so I'll have to leave it for now.

If I get the VM running again, I'll give your latest suggestions a try. If not, then I guess I'll set it up again and see if I can avoid some of the problems in the first place.
 
Top