unRAID 6 Beta 6: Docker Quick-Start Guide


Recommended Posts

Thanks for the guide Jon.

 

I've been using an ubuntu 14.04 VM with Docker as a playground and before this thread I thought I understood Docker/containers.................but now you've dropped base images, apt-get -q, butterFS :o ...........and native disk access

 

/deletes fstab and storms out

you just got dockerized ;-)

 

Sent from my Nexus 5 using Tapatalk

 

Link to comment
  • Replies 321
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

WOW thanks for this great update!!!  :-* this system seems really a better way to handle "plugins".

Thanks for integrating this to Unraid, i didn't know how powerful this was. And thanks also Jonp for a comprehensive FAQ.

 

Just one question, is there a way to a smooth transition? I mean by that to convert reizerfs cache disk to btrfs without reformatting. I try btrfs-convert but it seems to handle only ext* formatted drives.

Link to comment

WOW thanks for this great update!!!  :-* this system seems really a better way to handle "plugins".

Thanks for integrating this to Unraid, i didn't know how powerful this was. And thanks also Jonp for a comprehensive FAQ.

 

Just one question, is there a way to a smooth transition? I mean by that to convert reizerfs cache disk to btrfs without reformatting. I try btrfs-convert but it seems to handle only ext* formatted drives.

 

To be completely honest, we haven't done much research into the conversion process yet.  I think you can expect this to get better in the next beta (somehow, not promising an in-place conversion process), but for now, any conversion process work is going to be "swim at your own risk."

 

That said, he who wants to dive in first will definitely have our interest piqued for results!

Link to comment

I was able to get Plex running under docker but when trying to add sections, it seems that the VM can see the disk mounts on UNRAID but viewing them shows no contents. I updated the config files to add a mount point for /media linked to /mnt/user but it still doesn't display any contents.

 

How do telnet into the VM?

Link to comment

I was able to get Plex running under docker but when trying to add sections, it seems that the VM can see the disk mounts on UNRAID but viewing them shows no contents. I updated the config files to add a mount point for /media linked to /mnt/user but it still doesn't display any contents.

 

How do telnet into the VM?

 

When you entered your docker run command for installing plex, you should have specified two volume mappings between the host and the guest.  Would have looked like this in your command line:

 

-v /mnt/cache/appdata/plex:/config -v /mnt/user/media:/data

 

The separator in the value after -v is the colon.  The left side of the colon is path relative to your host.  The right side of the colon is the path relative to the container.  Each -v is a different host:client mapping.  The trick is to not use a path on either side that is a system path (like /etc or /bin).

 

The confusing part is why /disk1, /disk2 and so on even show up when browsing from within the container itself at all.  Not sure on that.  I know that they don't actually map to anything, but I am hoping we can find a way to clean that up in the future.

Link to comment

upgraded from v6b4 to v6b6 but not having any luck in getting plex docker or any other started

 

cannot access from the ipaddress:port

 

using

 

docker run -d  --net="host" --name="plex" -v /mnt/cache/appdata/plex:/config -v /mnt/user/media:/data -p 32400:32400 eschultz/docker-plex

 

which downloads fine, no errors but cannot access

 

docker is running, booted into standard OS mode and xen mode

 

root@Tower:~# docker inspect plex

[{

    "Args": [],

    "Config": {

        "AttachStderr": false,

        "AttachStdin": false,

        "AttachStdout": false,

        "Cmd": null,

        "CpuShares": 0,

        "Cpuset": "",

        "Domainname": "",

        "Entrypoint": [

            "/start.sh"

        ],

        "Env": [

            "HOME=/",

            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",

            "DEBIAN_FRONTEND=noninteractive"

        ],

        "ExposedPorts": {

            "32400/tcp": {}

        },

        "Hostname": "Tower",

        "Image": "eschultz/docker-plex",

        "Memory": 0,

        "MemorySwap": 0,

        "NetworkDisabled": false,

        "OnBuild": null,

        "OpenStdin": false,

        "PortSpecs": null,

        "StdinOnce": false,

        "Tty": false,

        "User": "",

        "Volumes": {

            "/config": {},

            "/data": {}

        },

        "WorkingDir": ""

    },

    "Created": "2014-06-19T18:43:34.745029434Z",

    "Driver": "btrfs",

    "ExecDriver": "native-0.2",

    "HostConfig": {

        "Binds": [

            "/mnt/cache/appdata/plex:/config",

            "/mnt/user/media:/data"

        ],

        "ContainerIDFile": "",

        "Dns": null,

        "DnsSearch": null,

        "Links": null,

        "LxcConf": [],

        "NetworkMode": "host",

        "PortBindings": {

            "32400/tcp": [

                {

                    "HostIp": "",

                    "HostPort": "32400"

                }

            ]

        },

        "Privileged": false,

        "PublishAllPorts": false,

        "VolumesFrom": null

    },

    "HostnamePath": "",

    "HostsPath": "/mnt/cache/docker/containers/e950799786c2861140f683541672b3f4fcce0f0ed928b9c7088427a867f6daf9/hosts",

    "Id": "e950799786c2861140f683541672b3f4fcce0f0ed928b9c7088427a867f6daf9",

    "Image": "ca32cda917289d54e6a316718838df57cc07ccd985485323a1f028f8b44e7326",

    "MountLabel": "",

    "Name": "/plex",

    "NetworkSettings": {

        "Bridge": "",

        "Gateway": "",

        "IPAddress": "",

        "IPPrefixLen": 0,

        "PortMapping": null,

        "Ports": null

    },

    "Path": "/start.sh",

    "ProcessLabel": "",

    "ResolvConfPath": "/etc/resolv.conf",

    "State": {

        "ExitCode": 1,

        "FinishedAt": "2014-06-19T18:43:35.303756566Z",

        "Paused": false,

        "Pid": 0,

        "Running": false,

        "StartedAt": "2014-06-19T18:43:35.184392363Z"

    },

    "Volumes": {

        "/config": "/mnt/cache/appdata/plex",

        "/data": "/mnt/user/media"

    },

    "VolumesRW": {

        "/config": true,

        "/data": true

    }

}

EDIT:

 

Now working after changing the docker standard directory

Link to comment

How do telnet into the VM?

 

One quick thing:  Docker doesn't manage VMs, it manages LXCs (containers).  I know the terminology can be confusing, but there is no emulated hardware stack involved with Docker (thus no QEMU/SeaBIOS/Xen/KVM requirements).

 

Oh and as for remote console access (SSH/telnet), you would need to install an daemon into a container to do that.  you'd also need to make sure you forward the port for that container from the guest to host.

 

At one point, we were considering using this for our base image: 

 

http://phusion.github.io/baseimage-docker/

https://github.com/phusion/baseimage-docker

 

This base image includes additional things as part of it's image including an SSH daemon.

Link to comment

If I understand this right, switching Unraid to use Ubuntu would allow for more reduction in the base image as well?

 

Is there any plans on an integrated manager (aka plugin manager) that could be configured to control all the LXC's from one uh... plugin?

 

Also, lets say I have couchpotato installed as a container, and the app has an update.  Can the app just be updated from within couchpotato or does there have to be a new container released incorporating the application update?

Link to comment

All docker files are stored on github and should auto update themselves.  I think in couchpotato's case, you can just update from within the app as all it does is replace some of the files with newer ones from github

 

As far as I saw, the container files point to the github source files anyway (for cp and sickbeard at least) sab container updates via apt-get

Link to comment

If I understand this right, switching Unraid to use Ubuntu would allow for more reduction in the base image as well?

 

I think I know where you're going with this, but let me make sure.  If you're asking if we loaded up unRAID on an Ubuntu Distro (stepped away from Slackware), would that further reduce the image footprint for VMs that share that base?  If that is your question, we honestly don't know for sure on that yet.  The theory is that COULD work, but we haven't tested it.  That said, moving unRAID to an alternative distro other than Slackware isn't really up for discussion right now.  This may change in the future, but it's not a discussion topic for unRAID 6.

 

Is there any plans on an integrated manager (aka plugin manager) that could be configured to control all the LXC's from one uh... plugin?

 

Boy these questions get confusing to even ask, don't they?!  In short, we are working on a way for folks to better and more universally control plugins, containers, and VMs.  The idea is that containers and VMs by themselves do not constitute an unRAID "Plugin."  The Plugin part is really about an easy way to control other applications running on unRAID from within the unRAID webGUI itself.  Here's a good example with something like SAB/CP/SB:

 

Each one of these applications could be installed in its own private container or they could be all installed in a single container (sharing the same OS environment space together).  It really doesn't matter in terms of the plugin authors ability to craft a webGUI page for controlling MULTIPLE containerized applications from within a single interface.  Each container could have a mount point for it's application data (think .conf or .ini files) that resolves to the host.  e.g. From the perspective of my SAB container, /config really maps to /mnt/cache/appdata/sab from the perspective of my unRAID host.  This way the plugin webGUI control could use PHP to parse the config files for the application JUST LIKE YOU DO TODAY!  It doesn't matter that they are in a container.  In fact, I've actually started containers with SAB, Plex, SB, and Couch pointing to my .conf files for those apps from my old unRAID 5 plugins and they all worked.

 

Also, lets say I have couchpotato installed as a container, and the app has an update.  Can the app just be updated from within couchpotato or does there have to be a new container released incorporating the application update?

 

In short, the app can be updated within couchpotato itself.  That update will persist even if you stop/restart the container.  But here's where things get really fun!  Let's say that CP had an update that would improve performance, but it needs a newer Python version than what it has from the common base image at the time.  You could choose to install the Python update to just the CP container and it would NOT update the Python version in the other containers.  Now let's say that an updated base image is released for Docker that also includes this update.  When new base images are released, we will have to essentially rebuild our containers, but since there is literally NO USER DATA inside the containers to begin with, this doesn't matter.  Throw away your old CP/SAB/SB containers and start fresh with the updated ones but keep them pointed to the same mount points on the host for their config folders!  It really is that simple!!

 

Simple test.  Run the plex container in this guide then do a docker rm plex.  This destroys that container completely.  Now do another docker run command for plex.  A new container will be built and if you specified the same paths for /confg and /data with your run statement, when you login to plex via the browser, all your metadata is intact and the app doesn't know the wiser!  It's really slick!!

Link to comment

I rm'ed the plex instance and recreated it with an additional share in the add container command, media came up spiffy. Recommend updating your plex instructions to include it.

 

docker run -d --net="host" --name="plex" -v /mnt/vm/docker/apps/appdata/plex:/config -v /mnt/vm/docker/apps/userdata:/data -v /mnt/user:/media -p 32400:32400 eschultz/docker-plex

Link to comment

I rm'ed the plex instance and recreated it with an additional share in the add container command, media came up spiffy. Recommend updating your plex instructions to include it.

 

docker run -d --net="host" --name="plex" -v /mnt/vm/docker/apps/appdata/plex:/config -v /mnt/vm/docker/apps/userdata:/data -v /mnt/user:/media -p 32400:32400 eschultz/docker-plex

 

LOL, I think my instructions are being misinterpreted.  You can replace the above red part with your blue part completely.  The second -v I have in my example is for what you appended as an EXTRA -v command.

Link to comment

Quick question on config folders. I have a reiserfs cache drive and a btrfs SSD external to the array that I installed docker on.

 

When I am setting up SAB, SB, CP, Plex do the config folder need to (or should they) reside on the btrfs drive, or can I point them to the reiserfs cache drive okay?

Link to comment

Another question. How do permissions work with the data?

 

When I moved my plugin installs into an Ubuntu vm, the only issue was setting the permissions right and it caused a lot of headaches. Since these docker containers are using Ubuntu as a base, I am wondering how they are handled with docker?

Link to comment

Quick question on config folders. I have a reiserfs cache drive and a btrfs SSD external to the array that I installed docker on.

 

When I am setting up SAB, SB, CP, Plex do the config folder need to (or should they) reside on the btrfs drive, or can I point them to the reiserfs cache drive okay?

 

The folders that you specify to map into a container from the host can be of whatever filesystem you like (reiserfs or btrfs).  It does not matter.  Docker itself is the only component that is required to reside on a btrfs formatted partition.

Link to comment

Another question. How do permissions work with the data?

 

When I moved my plugin installs into an Ubuntu vm, the only issue was setting the permissions right and it caused a lot of headaches. Since these docker containers are using Ubuntu as a base, I am wondering how they are handled with docker?

 

Hmm, not really sure to be totally honest.  In all our testing, everything "just worked" as we naturally expected it to (no config/permissions issues).  All I can ask is that you try it and see!

Link to comment

Possibly dumb question, but is there any reason I can't use -v to pass /mnt/user as /mnt/user to the docker container like this?

 

docker run -d -h hostname --name="sickbeard" -v /mnt/path/to/appdata/sabnzbd:/config -v /mnt/user:/mnt/user -p hostport:8080 -p hostport:9090 eschultz/docker-sickbeard

 

Don't want to have to reconfigure sickbeard if I don't need to

Link to comment

Possibly dumb question, but is there any reason I can't use -v to pass /mnt/user as /mnt/user to the docker container like this?

 

docker run -d -h hostname --name="sickbeard" -v /mnt/path/to/appdata/sabnzbd:/config -v /mnt/user:/mnt/user -p hostport:8080 -p hostport:9090 eschultz/docker-sickbeard

 

Don't want to have to reconfigure sickbeard if I don't need to

That's basically exactly what I did for Plex

Link to comment

Possibly dumb question, but is there any reason I can't use -v to pass /mnt/user as /mnt/user to the docker container like this?

 

docker run -d -h hostname --name="sickbeard" -v /mnt/path/to/appdata/sabnzbd:/config -v /mnt/user:/mnt/user -p hostport:8080 -p hostport:9090 eschultz/docker-sickbeard

 

Don't want to have to reconfigure sickbeard if I don't need to

That's basically exactly what I did for Plex

 

Did your plex pick up the media in that folder? During setup i can not get past the root folder level and plex will not scan media in any of the folder i mount /mnt/user/Movies

 

 

Link to comment
Guest
This topic is now closed to further replies.