Docker on 11.0

Status
Not open for further replies.

Jammin

Dabbler
Joined
Dec 28, 2016
Messages
42
I know docker will not be officially supported until FreeNAS 11.1, but this is not due until August - at least 3 months.

Has anyone experimented with spinning up Docker in a VM on 11.0 with something like RancherOS? In particular getting file sharing from the containers to the host (NFS?) working.

For those of us still running Corral due to the need for docker, this might get us onto the 11 train earlier.
 

maydo

Contributor
Joined
Jan 9, 2017
Messages
159
I'm also interested in this, does anybody find a way to run containers on fn11 ?

still on corral
 
Last edited by a moderator:

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
I don't see why you can't just run up a Ubuntu VM and have a crack, Docker isn't OS exclusive or anything...
Have a look at the threads regarding SMB shares and VM's though. I haven't tried other sharing methods as yet but SMB isn't working.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
@FreeNASftw
How do you implement your containers on Ubuntu? (If you are) are you using the cli or something like portainer?
I'm trying to find a gui for the docker on my Ubuntu vm that allows me to set up containers as easily as we could in corral.

Sent from my SM-G930F using Tapatalk
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
@FreeNASftw
How do you implement your containers on Ubuntu? (If you are) are you using the cli or something like portainer?
I'm trying to find a gui for the docker on my Ubuntu vm that allows me to set up containers as easily as we could in corral.

Sent from my SM-G930F using Tapatalk
I certainly don't claim to be a Docker expert, I literally went through the basics probably two months ago... Stepped through some simple tutorials etc. That was all CLI in Ubuntu server. As far as I'm aware, the host OS is of little importance except of course you don't want something heavy chewing resources unnecessarily.

If I get time I'll have another go tomorrow and probably install portainer too.

I was really only replying here because the question was fairly open to interpretation, there's a big difference between
does anybody find a way to run containers on fn11 ?
and 'has anyone developed a point and shoot integration of docker containers into FreeNAS 11'.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
So you are about as knowledgeable as me lol (no offence intended). I only started with docker around the same time and that was just on corral.
I do now have a Ubuntu 16.04 server vm with docker installed.

Sent from my SM-G930F using Tapatalk
 
Last edited by a moderator:

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
So your about as knowledgeable as me lol (no offence intended). I only started with docker around the same time and that was just on corral.
I do now have a Ubuntu 16.04 server vm with docker installed.

Sent from my SM-G930F using Tapatalk
Haha yep, I would say that that's an accurate assessment.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Haha yep, I would say that that's an accurate assessment.
I just really liked corrals implementation of a point and click docker setup. E.g.. browse to host path point to container path. The cli commands have me a bit confused but I should be able to wrap my bead around it soon enough. I know a bit about a bit lol.
(Currently studying cert IV in computer systems technology)(C# at the moment)

Sent from my SM-G930F using Tapatalk
 

FreeNASftw

Contributor
Joined
Mar 1, 2015
Messages
124
Lol I think I started an advanced Diploma of that a couple of years ago, the material was outdated and the support was rubbish so I passed a few modules and quit.

I never saw the Corral implementation, I got on the bandwagon too early and it it was unusable, then by the time I was ready to give it another go, I heard about it being deprecated, so here I am on 11 Nightlies. :)
 

MrDragon

Cadet
Joined
Apr 25, 2017
Messages
6
Fwiw, I run an Ubuntu 16 VM under FreeNAS-11-Nightly. FreeNAS shares its dataset via NFS to the VM.
The Ubuntu VM mounts that NFS share to 'somewhere convenient', and I can make that path visible to the docker containers as if it were a normal path.
I did the "keep it simple" setup, using "portainer" to manage my containers. I'm running the usual mediaserver containers (sonarr, sabnzbd, emby/plex), following (mostly) the directions from linuxserver.io
Yes, I copy/paste the docker create command into a file so I have it handy every time I remove a container and spin it back up :)

Works like a charm, and even Plex notices new arrivals automatically based on new directories/files popping up in my media directory.
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Care to share some of those commands :)

Sent from my SM-G930F using Tapatalk
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288

MrDragon

Cadet
Joined
Apr 25, 2017
Messages
6
Care to share some of those commands :)

Sure! Disclaimer: I'm a docker newbie. Totally green!

1) Create a VM and install Ubuntu. You already did that. Yay! :)
2) In FreeNAS, set up a datastore to share via NFS. I chose to create it with "All Directories" checked, because I want to be able to mount subdirectories individually. Make sure the "NFS" service is started in FreeNAS.
3) Mount that share in your Ubuntu VM. I'm old school (no autofs for me!), so I edited /etc/fstab and added:
Code:
192.168.1.10:/mnt/Pool/MediaFiles /home/Media  nfs rsize=8192,wsize=8192,timeo=14,intr

192.168.1.10 is the FreeNAS IP, /mnt/Pool/MediaFiles is the FreeNAS path, /home/Media is where I want to mount it in Ubuntu.
mount -a or mount /home/Media should mount that share - it gets automatically mounted at reboot due to the fstab entry. Also, make sure that rpc.statd and rpcbind are running on Ubuntu.

4) apt install docker.io (for some reason I used docker.io and not just docker. I assume I read somewhere that's either important or easy) If it doesn't run, start it with systemctl start docker.
5) I really like "portainer" from "portainer.io" to handle my containers. It doesn't do *everything* that you can do from the command line, but it does enough for me ;)
I installed/ran that via
Code:
docker run  \
  --name=portainer  \
  --restart=unless-stopped  \
  -d -p 9000:9000  \
  -v /var/run/docker.sock:/var/run/docker.sock \
  portainer/portainer

It REALLY makes sense to put those commands into a file and execute that file sh FILE :)
Then open your browser and go to "ip-of-ubuntu:9000"

6) Head on over to "linuxserver.io", go to "docker images". Click on whatever catches your eye, for instance "sabnzbd" :) They give you step-by-step instructions. I copy/paste the "usage" part into a file and edit it in there so I remember the settings. Make sure you edit the various settings, especially take care of the "-v" directory mappings. Basically you map an Ubuntu path to an internal docker-container path. You should NOT rename the container paths, only mess with the left part ;)

I add an option near the top " --restart=unless-stopped" if I want that container to start up automatically (unless if I stopped it!)

Now, the neat thing is: If you screw up with the pathnames, timezone setting, or anything when you "created" your container - let's say you're sticking your movies into the wrong folder, you have to remove and recreate the container (there may be better ways, but hey. I said I was new!)
To do that: Either remove the container in portainer or say:
docker rm <whatever-you-named-the-container in the --name option> For instance docker rm sabnzbd or docker rm portainer.
Then edit the file where you set everything up (see above, told you it was a good idea) and re-run that file (or the docker run/create command)

The neat thing is, unless you messed up the "ubuntu=path:/config" setting for your container, all the settings are still there! I've probably re-done "sonarr" half a dozen times because of my inexperience with the path mappings (where do the TV shows go? What's the path to where sab saves the downloads again?) but never had to set up Sonarr from scratch - just tweak it.

I hope that helps to get you started - and I hope I didn't miss anything important!

Frank

Edit: PS! I ran all the commands as root. sudo -i is my friend!
 
Last edited by a moderator:

Jammin

Dabbler
Joined
Dec 28, 2016
Messages
42
Sure! Disclaimer: I'm a docker newbie. Totally green!

That's awesome, thanks so much for taking the time to do that.

Since I don't really have a spare machine to install 11.0 nightlies and try this, I am going to install a new VM in Corral and play with this. The ubuntu/docker part should be the same I guess and it will give me an idea if I'm willing to take the plunge.
 
Last edited:

mow4cash

Contributor
Joined
Jan 20, 2017
Messages
132
I sure hope Corral can hold up for 3+ months or the option in this thread turns out to be good enough to make the switch. I can't stress enough how nice it is to use Docker in Corral.
 

D1NZ

Cadet
Joined
Mar 20, 2017
Messages
8
I sure hope Corral can hold up for 3+ months or the option in this thread turns out to be good enough to make the switch. I can't stress enough how nice it is to use Docker in Corral.
I actually did fresh install with Corral during beta and it ran rock solid for a month or so til the release was hit, did another fresh install after that.
I don't see why not it couldn't hold up for another 3 months, I am also waiting for the Docker to come back into FreeNAS current version.
 

mjt5282

Contributor
Joined
Mar 19, 2013
Messages
139
I took to Docker like a duck to water, I have 4 containers and feel like I am just scratching the surface. I will be treading Corral until FN 11+Docker is released officially (plus two weeks :smile: ).
 

D1NZ

Cadet
Joined
Mar 20, 2017
Messages
8

TheFunk35

Cadet
Joined
Apr 3, 2017
Messages
5
I sure hope Corral can hold up for 3+ months or the option in this thread turns out to be good enough to make the switch. I can't stress enough how nice it is to use Docker in Corral.

In case any of the Devs are poking around here, I'd like to second this sentiment. Brand new user, just got my NAS drives the week Corral was released and immediately installed it. I have over 4TB of data on my FreeNAS Corral box now and four Docker VMs up and running. I plan to hold off on the upgrade until Docker is point and click again. It was so simple to just download an image from the Web UI and have it ready to go and fully functional, and I'd never used Docker before in my life. Passing through folders from my main SMB share was easy too!

I definitely recognize the need for getting rid of the Corral UI and returning to a stable codebase, I'm a programmer too, but if there's one thing that Corral got right, it was that Docker implementation. Please Devs, give me that beautiful pointy-clicky goodness in 11.1, and I promise I won't ask for anything else!
 
Status
Not open for further replies.
Top