Dockerization of some popular applications.


Recommended Posts

I got really excited once unRAID included native Docker support. I spent some time turning some of my apps into Dockfiles so I can get away from KVM/Xen. Yes I know there are many such files out there and I did reinvent the wheel a bit but it was fun to learn and work with. I uploaded them to the Hub in case any one was interested...

 

All of my Docks use Baseimage-Docker as a base which has a lot of great features and is very fast.

 

My Docks do not run as the root user which is a "bad thing". All run as nobody:users except for Plex which runs as plex:users. PlexWatch's apache runs as a www-data. These Docks have been developed focused on unRAID.

 

couchpotato - https://registry.hub.docker.com/u/needo/couchpotato/'>https://registry.hub.docker.com/u/needo/couchpotato/

nzbget - https://registry.hub.docker.com/u/needo/nzbget/'>https://registry.hub.docker.com/u/needo/nzbget/

nzbdrone - https://registry.hub.docker.com/u/needo/nzbdrone/'>https://registry.hub.docker.com/u/needo/nzbdrone/

plex (plexpass) - https://registry.hub.docker.com/u/needo/plex/'>https://registry.hub.docker.com/u/needo/plex/

plexWatch - https://registry.hub.docker.com/u/needo/plexwatch/'>https://registry.hub.docker.com/u/needo/plexwatch/

nzbmegasearch - https://registry.hub.docker.com/u/needo/nzbmegasearch/'>https://registry.hub.docker.com/u/needo/nzbmegasearch/

deluge - https://registry.hub.docker.com/u/needo/deluge/'>https://registry.hub.docker.com/u/needo/deluge/

sabnzbd - https://registry.hub.docker.com/u/needo/sabnzbd/'>https://registry.hub.docker.com/u/needo/sabnzbd/

sickbeard - https://registry.hub.docker.com/u/needo/sickbeard/'>https://registry.hub.docker.com/u/needo/sickbeard/

sickrage - https://registry.hub.docker.com/u/needo/sickrage/'>https://registry.hub.docker.com/u/needo/sickrage/

PlexConnect: https://registry.hub.docker.com/u/needo/plexconnect'>https://registry.hub.docker.com/u/needo/plexconnect

mariadb: https://registry.hub.docker.com/u/needo/mariadb'>https://registry.hub.docker.com/u/needo/mariadb

 

Source code is available at https://registry.hub.docker.com/u/needo/ and https://github.com/needo37

 

These applications are not installed with git. In application updates will not work. I keep these up to date.

 

The ultimate size of these Docks is very small, I am a minimalist and prefer things to be as lightweight as possible:

 

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
needo/plex          latest              f23d6a185931        9 hours ago         464.3 MB
needo/nzbdrone      latest              4bf609d8f0cf        9 hours ago         496.2 MB
needo/plexwatch     latest              bcfd4cee31e9        10 hours ago        278 MB
needo/nzbget        latest              0608f3894994        10 hours ago        228.1 MB
needo/couchpotato   latest              74e9cc61cacb        10 hours ago        211.9 MB

 

If you find any bugs please post them here.

 

CHANGELOG

06/22/2014

  • (All) Removed timezone symlink. Please use -v /etc/localtime:/etc/localtime:ro to use the same timezone as your unRAID system
  • (CouchPotato) Removed git for the install and use the latest stable v2.4.0 release
  • (plexWatch) Removed git for the install and use the latest stable v1.5.4.2 release
  • (nzbmegasearch) Removed git for the install and use the latest stable v0.46 release
  • (All) Updated documentation

06/23/2014

06/24/2014

06/25/2014

  • (ALL) Migrated from debian:jessie to phuzion/baseimage:0.9.11
  • (mariadb) When initializing a new database root can connect from anywhere with no password
  • (plex) It is now possible to specify which version of PlexMediaServer you want to install. See README for more details.
  • (couchpotato)(sickbeard)(sickrage)(plexwatch)(nzbmegasearch)(plexconnect) By default the latest stable version of these applications will be installed. By specifying a variable in the docker run command the latest master branch will be installed and in-app updates will be functional. Please see the respective READMEs for more details.

06/28/2014

  • (nzbget) Fix nzbget.conf
  • (all) Update documentation. Fixing typos and put things in code blocks.
  • (sickbeard)(sickrage)(couchpotato) Add unrar per request

06/30/2014

  • (couchpotato) Upgrade stable couchpotato to v2.5.1.

07/2/2014

  • (nzbdrone) Upgrade stable nzbdrone.
  • (nzbget) Add ffmpeg for nzbToMedia users.

07/7/2014

  • (sabnzbd) Upgrade to stable sabnzbd.
  • (sabnzbd) Add ffmpeg for nzbToMedia users.

07/23/2014

  • (nzbdrone) Upgrade stable nzbdrone.

07/31/2014

  • (plex) Upgrade to latest version.
  • (nzbget) Accepted merge request, and fixed some bugs.

08/13/2014

  • (plex) Upgrade to latest version.

08/19/2014

  • (plex) Upgrade to latest version.

09/08/2014

  • (plex) Upgrade to latest version.
  • (deluge) Add extraction files per request.

Link to comment

I just installed your nzbdrone container, but I've never used nzbdrone before, so I have a question.  How do I specify the path for an existing show?  I used this command to install...

 

docker run -d --name="nzbdrone" -h media -v /mnt/cache/appdata/nzbdrone:/config -v /mnt/user/cache/downloads:/downloads -v /mnt/user/video/TV/Archive:/tv -p 9989:8989 needo/nzbdrone

 

which I think would but the base of my directory inside nzbdrone at /mnt/user/video/TV/Archive/ which makes me think I should be able to just put Elementary for the location, as that's the next subfolder, but that didn't work.  There doesn't seem to be a 'browse' button, so I can't get to anyplace that just lets me browse to my location, so I have to guess as to what to enter here (this design could use some improvement).

 

anyway, if you have any ideas, I'd appreciate it.

 

thanks again.

Link to comment

I've been searching around on this, and I'm a bit confused.  I've never used docker before, so please forgive what may be stupid questions.

 

How did you determine that you (I/we) had to pass path information to /downloads and to /tv?  I've not found where these come from, I just filled in what seemed right, based on your example run command in the docker repo.

 

It seems that what I entered isn't quite working, so I'm tempted to just do /mnt/user:/data instead of the 2 separate ones, but wanted to see if there was more information on this before I proceed.

 

however, I think it's super easy to just delete the container, try this change, and if it doesn't work, delete that one and try again.

 

Anyway, thanks again.

Link to comment

I ended up changing the command to this...

 

docker run -d --name="nzbdrone" -h media -v /mnt/cache/appdata/nzbdrone:/config -v /mnt/user:/mnt/user -p 9989:8989 needo/nzbdrone

 

And now, from inside nzbdrone, I can access my files with /mnt/user/whatever

 

I've just finished importing my shows, and it's found a few episodes for me.  So far, I really like nzbdrone!

Link to comment

thanks for the update.  I assume that I could simply run "docker rm nzbdrone" to remove the current container, then re-run the command to re-install the container, but I'm not positive this would result in me getting your updated container.  I'm not sure if there is an update command for docker containers.  I'll look into it further when you are finished.

 

Also, if you have some time, if you wouldn't mind writing a quick, high-level step by step for building a container, I'd like to build one for SickRage (although I like nzbdrone I may just stick with it now), and also one for MakeMKV, so I can run it from my laptop, but actually run it on the server.

 

thanks again!

Link to comment

I had to update my nzbget. I learned that I had to do the following:

 

docker stop nzbget

docker rm nzbget

docker rmi needo/nzbget

 

And then I had to re-run the docker run... command. I am not sure if there is an easier/better way to do it.

Link to comment

You mentioned earlier something about changing permissions in you container, what did you have to change, and did you change anything else (just curious)?

 

Also, you show you had to run

 

docker rmi needo/nzbget

 

and from what I can see in my reading, this is to remove the container from the docker repo.  I assume I won't need to do this also, I can stop at

 

docker rm nzbget

 

I've been reading the docker user guide most of the day, and it seems that building a dockerfile is a good way to 'automate' the building of containers, but I'm not a programmer, so I'm not quite sure how exactly to put one together, and not miss critical components, or just do something stupid.

 

Are you using dockerfiles to build your images?  Is that the best/easiest way?

Link to comment

You mentioned earlier something about changing permissions in you container, what did you have to change, and did you change anything else (just curious)?

 

I changed it so nzbget, nzbdrone, and couchpotato ran as the nobody user with a group of users to make it more friendly to unRAID. For plex I have it running as the plex user with the group users. For the same reason.

 

Are you using dockerfiles to build your images?  Is that the best/easiest way?

 

I am using dockerfiles. As far as I know it is the best/easiest way.

Link to comment

Cool.  I'll rm the nzbdrone container I have now, and pull your new one.  I'm curious if it knows the image has changed automatically, or if I have to 'force' it to get the updated one.

 

Would you mind sharing one of your dockerfiles with me?  I'm not yet comfortable enough to try building one from scratch, but I think I could follow along well enough to modify it to get what I'm looking for.

 

Either way, thanks again.

 

I'm also very happy/impressed with Docker so far.  I agree that everything feels much faster and smoother, and it was up and running much more easily than my VM experience.

 

I still need a Windows VM on my server, so I need to keep XEN or move to KVM.  I suspect I'll be moving to KVM, since it seems better equipped to do GPU passthru, but I want to get the docker images pretty much squared away before moving to another major change (one potential problem at a time :))

Link to comment

Just tried your plexpass docker container, appears to have installed correctly, but when I try to browse to it I am unable to connect. Any suggestions?

 

What error do you get when you try to connect?

 

What command line are you using?

 

What URL are you trying to connect to?

Link to comment

Nevermind, problem was due to file permissions trying to reuse my old plex config folder from the limetech plex container. Ran chmod -R 777 on the directory and it works fine now. Probably not the most secure thing to do though

 

EDIT: Command I used to start your container "docker run -d --net="host" --name="plexpass" -v /mnt/cache/appdata/plex:/config -v /mnt/user:/data -p 32400:32400 needo/plex" Was just getting "chrome is unable to connect to tower:32400"

Link to comment

Nevermind, problem was due to file permissions trying to reuse my old plex config folder from the limetech plex container. Ran chmod -R 777 on the directory and it works fine now. Probably not the most secure thing to do though

 

EDIT: Command I used to start your container "docker run -d --net="host" --name="plexpass" -v /mnt/cache/appdata/plex:/config -v /mnt/user:/data -p 32400:32400 needo/plex" Was just getting "chrome is unable to connect to tower:32400"

 

out of curiosity, why to you have --net="host" in there?  I've been using -h media in my commands (media is my hostname).  What is the --net supposed to be setting?

Link to comment

out of curiosity, why to you have --net="host" in there?  I've been using -h media in my commands (media is my hostname).  What is the --net supposed to be setting?

 

I could not get plex.tv to talk to my server with the -h setting so I had to use --net="host".

Link to comment

I had to update my nzbget. I learned that I had to do the following:

 

docker stop nzbget

docker rm nzbget

docker rmi needo/nzbget

 

And then I had to re-run the docker run... command. I am not sure if there is an easier/better way to do it.

 

Okay, so I wasn't paying enough attention and thought you'd updated nzbdrone, so I followed these same steps to get the new version.

 

it didn't report any errors, all seemed fine, it removed all the image files, then reinstalled everything from scratch.  no errors, no problems.

 

however, now the nzbdrone container won't run.  it shows in docker images, but docker start nzbdrone acts like it works, it feeds back nzbdrone on the next line, but it doesn't actually start, and never shows in docker ps

 

ideas?

Link to comment

I had to update my nzbget. I learned that I had to do the following:

 

docker stop nzbget

docker rm nzbget

docker rmi needo/nzbget

 

And then I had to re-run the docker run... command. I am not sure if there is an easier/better way to do it.

 

Okay, so I wasn't paying enough attention and thought you'd updated nzbdrone, so I followed these same steps to get the new version.

 

it didn't report any errors, all seemed fine, it removed all the image files, then reinstalled everything from scratch.  no errors, no problems.

 

however, now the nzbdrone container won't run.  it shows in docker images, but docker start nzbdrone acts like it works, it feeds back nzbdrone on the next line, but it doesn't actually start, and never shows in docker ps

 

ideas?

 

Remove the container/image again, when you go to run the next time, remove the -d from the command (-d sends the container to run as a background process when done, whereas no -d lets you see it.  If you want to be interactive inside the container, you can add -i to the run command.

Link to comment

EPIC FAIL! (dockers words, not mine)

 

root@media:/# docker run --name="nzbdrone" -h media -v /mnt/cache/appdata/nzbdrone:/config -v /mnt/user:/mnt/user -p 9989:8989 needo/nzbdrone
Unable to find image 'needo/nzbdrone' locally
Pulling repository needo/nzbdrone
15190f9020fe: Download complete
511136ea3c5a: Download complete
d1881793a057: Download complete
b164861940b8: Download complete
3ae7e866e4c0: Download complete
e4fd1556ee5d: Download complete
53938eb5554f: Download complete
cba6547786ca: Download complete
bcf7ec4ee4b0: Download complete
d4e49abed803: Download complete
c29ad5c68aa5: Download complete
a52d8fd7b415: Download complete
9ca97a5145dd: Download complete
1e03f302eba7: Download complete
cdb5837b6ce4: Download complete
05f755f12157: Download complete
4521d03e8b95: Download complete
cfa8b768ca16: Download complete
8196b635468c: Download complete
ed676e8a06c1: Download complete
[info] Bootstrap: Starting NzbDrone - /opt/NzbDrone/NzbDrone.exe - Version 2.0.0.1581
[Error] PidFileProvider: Unable to write PID file: /config/nzbdrone.pid


[Fatal] ConsoleApp: EPIC FAIL!

System.UnauthorizedAccessException: Access to the path "/config/nzbdrone.pid" is denied.
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0
  at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool,System.Text.Encoding)
  at System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
  at System.IO.File.WriteAllText (System.String path, System.String contents) [0x00000] in <filename unknown>:0
  at NzbDrone.Common.Processes.PidFileProvider.Write () [0x00000] in <filename unknown>:0

Press any key to exit...

Link to comment

EPIC FAIL! (dockers words, not mine)

 

root@media:/# docker run --name="nzbdrone" -h media -v /mnt/cache/appdata/nzbdrone:/config -v /mnt/user:/mnt/user -p 9989:8989 needo/nzbdrone
Unable to find image 'needo/nzbdrone' locally
Pulling repository needo/nzbdrone
15190f9020fe: Download complete
511136ea3c5a: Download complete
d1881793a057: Download complete
b164861940b8: Download complete
3ae7e866e4c0: Download complete
e4fd1556ee5d: Download complete
53938eb5554f: Download complete
cba6547786ca: Download complete
bcf7ec4ee4b0: Download complete
d4e49abed803: Download complete
c29ad5c68aa5: Download complete
a52d8fd7b415: Download complete
9ca97a5145dd: Download complete
1e03f302eba7: Download complete
cdb5837b6ce4: Download complete
05f755f12157: Download complete
4521d03e8b95: Download complete
cfa8b768ca16: Download complete
8196b635468c: Download complete
ed676e8a06c1: Download complete
[info] Bootstrap: Starting NzbDrone - /opt/NzbDrone/NzbDrone.exe - Version 2.0.0.1581
[Error] PidFileProvider: Unable to write PID file: /config/nzbdrone.pid


[Fatal] ConsoleApp: EPIC FAIL!

System.UnauthorizedAccessException: Access to the path "/config/nzbdrone.pid" is denied.
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0
  at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool,System.Text.Encoding)
  at System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) [0x00000] in <filename unknown>:0
  at System.IO.File.WriteAllText (System.String path, System.String contents) [0x00000] in <filename unknown>:0
  at NzbDrone.Common.Processes.PidFileProvider.Write () [0x00000] in <filename unknown>:0

Press any key to exit...

 

Run this command to correct the permissions:

 

chown -R nobody:users /mnt/cache/appdata/nzbdrone

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.