sparklyballs Posted December 14, 2014 Share Posted December 14, 2014 i'm uploading my first docker to the docker hub and i'd like to make a small repo for my personal tweaks to dockers, can i use your xml files on github as a template please. Go for it. If you need any help let me know. I might pick your brains about environment variables, what i'm hoping to be able to do is have XBMC headless docker take in the settings for mysql via the template settings for variables and pass that through to a config file in the docker. Get it as "plug n play" as possible. I'm just not sure how to implement it from the template side and the docker side itself. That's for tomorrow though, it's movie time now, lol. I've modified one of your firstrun.sh scripts to hopefully cover the first part of getting the advancedsettings.xml file into the right directory on startup if it doesn't already exist. thus:- #!/bin/bash #make .xbmc/userdata folder if it doesn't exist yet, so test below does not fail. mkdir -p /root/.xbmc/userdata # Check if advancedsettins.xml exists. If not, copy in sample advancedsettings.xml if [ -f /root/.xbmc/userdata/advancedsettings.xml ]; then echo "Using existing advancedsettings.xml file." else mkdir -p /root/.xbmc/userdata chown root:root /root/advancedsettings.xml mv /root/advancedsettings.xml /root/.xbmc/userdata/advancedsettings.xml fi if this works, then i'm going to need to work out how to pass variables from the template into the advancedsettings.xml file, i'm guessing some kind of sed type arrangement. Would you want the advancedsettings.xml to be accessible to the user or contained in the docker? If you want it accessible to the user you may want to make a volume and do a symbolic link? i'd like it accessible so people can add any tweaks of their own to advancedsettings, the issue i seem to be having is that when xbmc first runs it creates a set of folders for itself (usually in the users home folder, or in opt if run in portable mode), trying to add in another file to those folders is proving problematic. the attempt with the firstrun.sh approach failed, i can inject the settings for the webserver into the settings.xml file at the compile stage so they are automatically the default setting, it's just getting the settings for mysql host, that you have to have in advancedsettings.xml. I would run it in portable mode and see where it creates those folders. Then you could (in the Dockerfile) do a VOLUME ["/opt/xmbc/createdfolder1", "/opt/xmbc/createdfolder2", "/opt/xmbc/createdfolder3"] and allow the user to choose where those folders are on unRAID. When XBMC runs it should create those folders on the host instead of in the container. If i adopt this approach can i put files in the volume on the container side , because the default setup for xbmc is no advancedsettings.xml file, you explicitly have to create one. Link to comment
smdion Posted December 14, 2014 Author Share Posted December 14, 2014 i'm uploading my first docker to the docker hub and i'd like to make a small repo for my personal tweaks to dockers, can i use your xml files on github as a template please. Go for it. If you need any help let me know. I might pick your brains about environment variables, what i'm hoping to be able to do is have XBMC headless docker take in the settings for mysql via the template settings for variables and pass that through to a config file in the docker. Get it as "plug n play" as possible. I'm just not sure how to implement it from the template side and the docker side itself. That's for tomorrow though, it's movie time now, lol. I've modified one of your firstrun.sh scripts to hopefully cover the first part of getting the advancedsettings.xml file into the right directory on startup if it doesn't already exist. thus:- #!/bin/bash #make .xbmc/userdata folder if it doesn't exist yet, so test below does not fail. mkdir -p /root/.xbmc/userdata # Check if advancedsettins.xml exists. If not, copy in sample advancedsettings.xml if [ -f /root/.xbmc/userdata/advancedsettings.xml ]; then echo "Using existing advancedsettings.xml file." else mkdir -p /root/.xbmc/userdata chown root:root /root/advancedsettings.xml mv /root/advancedsettings.xml /root/.xbmc/userdata/advancedsettings.xml fi if this works, then i'm going to need to work out how to pass variables from the template into the advancedsettings.xml file, i'm guessing some kind of sed type arrangement. Would you want the advancedsettings.xml to be accessible to the user or contained in the docker? If you want it accessible to the user you may want to make a volume and do a symbolic link? i'd like it accessible so people can add any tweaks of their own to advancedsettings, the issue i seem to be having is that when xbmc first runs it creates a set of folders for itself (usually in the users home folder, or in opt if run in portable mode), trying to add in another file to those folders is proving problematic. the attempt with the firstrun.sh approach failed, i can inject the settings for the webserver into the settings.xml file at the compile stage so they are automatically the default setting, it's just getting the settings for mysql host, that you have to have in advancedsettings.xml. I would run it in portable mode and see where it creates those folders. Then you could (in the Dockerfile) do a VOLUME ["/opt/xmbc/createdfolder1", "/opt/xmbc/createdfolder2", "/opt/xmbc/createdfolder3"] and allow the user to choose where those folders are on unRAID. When XBMC runs it should create those folders on the host instead of in the container. If i adopt this approach can i put files in the volume on the container side , because the default setup for xbmc is no advancedsettings.xml file, you explicitly have to create one. Yes, you could have a file called advancedsettings.xml in your GIT and use the ADD command.. I did this in my apache reverse proxy docker. Link to comment
sparklyballs Posted December 14, 2014 Share Posted December 14, 2014 Yes, you could have a file called advancedsettings.xml in your GIT and use the ADD command.. I did this in my apache reverse proxy docker. trying a while loop in firstrun file , basically all the while the userdata folder doesn't exist just echo out some bumpf, then when it does exist, copy the advanced settings file to it. fingers crossed this will work, lol. #!/bin/bash # Check if userdata folder exists. If not,loop echo until it does while [ ! -d /root/.xbmc/userdata ] echo "Waiting for userdata folder to be created" done mv /root/advancedsettings.xml /root/.xbmc/userdata/advancedsettings.xml chown root:root /root/.xbmc/userdata/advancedsettings.xml Link to comment
needo Posted December 15, 2014 Share Posted December 15, 2014 Hey man, there is an error in your maraschino docker when utilizing it with PLEX=1 or NZBDRONE=1... E: Unable to locate package git /etc/my_init.d/plex.sh: line 9: git: command not found In the shell scripts or in the Dockerfile you need an apt-get update before the apt-get install. Hope this helps! Link to comment
smdion Posted December 15, 2014 Author Share Posted December 15, 2014 Hey man, there is an error in your maraschino docker when utilizing it with PLEX=1 or NZBDRONE=1... E: Unable to locate package git /etc/my_init.d/plex.sh: line 9: git: command not found In the shell scripts or in the Dockerfile you need an apt-get update before the apt-get install. Hope this helps! Thanks needo. I did a few clean ups on my dockers to make them smaller and forgot some edge cases needed GIT. I'll clean them up. Link to comment
smdion Posted December 17, 2014 Author Share Posted December 17, 2014 Update: Migrated to Phusion 0.9.15 Added inotify-tools to Reverse Proxy DDClient DDNSnix UpStatsBoard Nginx Polipo Now when you edit a file in the dockers corresponding /config folder it will restart the needed service. Link to comment
eroz Posted December 17, 2014 Share Posted December 17, 2014 Not sure what happened....but Reverse-Proxy is not sending the websites I had configured with the latest update. root@localhost:# /usr/bin/docker logs --tail=350 Reverse-Proxy *** Running /etc/my_init.d/firstrun.sh... Using existing config file. *** Running /etc/my_init.d/inotify.sh... Setting up watches. Watches established. *** An error occurred. Aborting. *** Shutting down /etc/my_init.d/inotify.sh (PID ... *** Init system aborted. *** Killing all processes... *** Running /etc/my_init.d/firstrun.sh... Using existing config file. *** Running /etc/my_init.d/inotify.sh... Setting up watches. Watches established. *** An error occurred. Aborting. *** Shutting down /etc/my_init.d/inotify.sh (PID ... *** Init system aborted. *** Killing all processes... *** Running /etc/my_init.d/firstrun.sh... Using existing config file. *** Running /etc/my_init.d/inotify.sh... Setting up watches. Watches established. The command finished successfully! I had run the update from the docker page, Reverse-Proxy restarted and of course it did not work. I figured it was because I needed to stop Nzbget, Sonarr and Couchpotato and restart. So I stop them all including Reverse-Proxy. I restarted REverse-Proxy waited a few minutes and then started the other three, one-at-a-time. The sites are up if I go to Tower:port# but if I use my domain.com/nzbget, it does not load. Link to comment
smdion Posted December 17, 2014 Author Share Posted December 17, 2014 Not sure what happened....but Reverse-Proxy is not sending the websites I had configured with the latest update. root@localhost:# /usr/bin/docker logs --tail=350 Reverse-Proxy *** Running /etc/my_init.d/firstrun.sh... Using existing config file. *** Running /etc/my_init.d/inotify.sh... Setting up watches. Watches established. *** An error occurred. Aborting. *** Shutting down /etc/my_init.d/inotify.sh (PID ... *** Init system aborted. *** Killing all processes... *** Running /etc/my_init.d/firstrun.sh... Using existing config file. *** Running /etc/my_init.d/inotify.sh... Setting up watches. Watches established. *** An error occurred. Aborting. *** Shutting down /etc/my_init.d/inotify.sh (PID ... *** Init system aborted. *** Killing all processes... *** Running /etc/my_init.d/firstrun.sh... Using existing config file. *** Running /etc/my_init.d/inotify.sh... Setting up watches. Watches established. The command finished successfully! I had run the update from the docker page, Reverse-Proxy restarted and of course it did not work. I figured it was because I needed to stop Nzbget, Sonarr and Couchpotato and restart. So I stop them all including Reverse-Proxy. I restarted REverse-Proxy waited a few minutes and then started the other three, one-at-a-time. The sites are up if I go to Tower:port# but if I use my domain.com/nzbget, it does not load. So this is what happens when a guy who knows just enough to be dangerous makes dockers people enjoy using. Today I learned the difference between init.d and service. Reverse Proxy is working, updates coming quickly to other dockers. Edit: others fixed Link to comment
eroz Posted December 17, 2014 Share Posted December 17, 2014 So this is what happens when a guy who knows just enough to be dangerous makes dockers people enjoy using. Today I learned the difference between init.d and service. Reverse Proxy is working, updates coming quickly to other dockers. Edit: others fixed Awesome! Working again. Thanks for the quick update. Link to comment
smdion Posted December 17, 2014 Author Share Posted December 17, 2014 So this is what happens when a guy who knows just enough to be dangerous makes dockers people enjoy using. Today I learned the difference between init.d and service. Reverse Proxy is working, updates coming quickly to other dockers. Edit: others fixed Awesome! Working again. Thanks for the quick update. It seems the containers change around the PID and the inotify script is having problems stopping and restarting the services. Working through that now. Is seeing the changes for sure. Link to comment
sparklyballs Posted December 17, 2014 Share Posted December 17, 2014 i'm uploading my first docker to the docker hub and i'd like to make a small repo for my personal tweaks to dockers, can i use your xml files on github as a template please. Go for it. If you need any help let me know. I might pick your brains about environment variables, what i'm hoping to be able to do is have XBMC headless docker take in the settings for mysql via the template settings for variables and pass that through to a config file in the docker. Get it as "plug n play" as possible. I'm just not sure how to implement it from the template side and the docker side itself. That's for tomorrow though, it's movie time now, lol. I've modified one of your firstrun.sh scripts to hopefully cover the first part of getting the advancedsettings.xml file into the right directory on startup if it doesn't already exist. thus:- #!/bin/bash #make .xbmc/userdata folder if it doesn't exist yet, so test below does not fail. mkdir -p /root/.xbmc/userdata # Check if advancedsettins.xml exists. If not, copy in sample advancedsettings.xml if [ -f /root/.xbmc/userdata/advancedsettings.xml ]; then echo "Using existing advancedsettings.xml file." else mkdir -p /root/.xbmc/userdata chown root:root /root/advancedsettings.xml mv /root/advancedsettings.xml /root/.xbmc/userdata/advancedsettings.xml fi if this works, then i'm going to need to work out how to pass variables from the template into the advancedsettings.xml file, i'm guessing some kind of sed type arrangement. Would you want the advancedsettings.xml to be accessible to the user or contained in the docker? If you want it accessible to the user you may want to make a volume and do a symbolic link? i'd like it accessible so people can add any tweaks of their own to advancedsettings, the issue i seem to be having is that when xbmc first runs it creates a set of folders for itself (usually in the users home folder, or in opt if run in portable mode), trying to add in another file to those folders is proving problematic. the attempt with the firstrun.sh approach failed, i can inject the settings for the webserver into the settings.xml file at the compile stage so they are automatically the default setting, it's just getting the settings for mysql host, that you have to have in advancedsettings.xml. I would run it in portable mode and see where it creates those folders. Then you could (in the Dockerfile) do a VOLUME ["/opt/xmbc/createdfolder1", "/opt/xmbc/createdfolder2", "/opt/xmbc/createdfolder3"] and allow the user to choose where those folders are on unRAID. When XBMC runs it should create those folders on the host instead of in the container. If i adopt this approach can i put files in the volume on the container side , because the default setup for xbmc is no advancedsettings.xml file, you explicitly have to create one. Yes, you could have a file called advancedsettings.xml in your GIT and use the ADD command.. I did this in my apache reverse proxy docker. I cracked it, instead of moving just the advancedsettings.xml file across, i transferred my complete folder set across from another working setup, now when i move the whole folder setup, xbmc doesn't create new ones at all. Now stage 2, work out the sed commands for editing the file prior to the initial move, then i can whack it in a repo as pretty much appliance like version of XBMC-headless. thanks for your help, it was your reverse proxy way of doing things with the firstrun.sh that worked, it was just i was too tied up on just moving the one file and not all the folders. got there eventually though. Link to comment
hellow Posted December 17, 2014 Share Posted December 17, 2014 Smdion thanks for the blogpost, it's was very clear Link to comment
smdion Posted December 17, 2014 Author Share Posted December 17, 2014 Smdion thanks for the blogpost, it's was very clear Glad it helped! Link to comment
hellow Posted December 17, 2014 Share Posted December 17, 2014 If you want to have htpc-manager that includes sonarr and other improvements you can use this one https://github.com/Hellowlol/HTPC-Manager. Link to comment
smdion Posted December 17, 2014 Author Share Posted December 17, 2014 If you want to have htpc-manager that includes sonarr and other improvements you can use this one https://github.com/Hellowlol/HTPC-Manager. Oh, my, goodness. I could hug you. Link to comment
sparklyballs Posted December 17, 2014 Share Posted December 17, 2014 I've worked out my sed commands to add mysql details directly into advancedsettings.xml and i'm ready to go to repo now, do any of your xml files have variables settings in them so i can get a handle on how to use them ? Link to comment
smdion Posted December 17, 2014 Author Share Posted December 17, 2014 I've worked out my sed commands to add mysql details directly into advancedsettings.xml and i'm ready to go to repo now, do any of your xml files have variables settings in them so i can get a handle on how to use them ? Maraschino Dockerfile: https://github.com/smdion/docker-containers/tree/master/maraschino XML: https://github.com/smdion/docker-containers/blob/templates/smdion-repo/Maraschino.xml Link to comment
mgworek Posted December 18, 2014 Share Posted December 18, 2014 I am new to Dockers so sorry if this question is stupid. Is there a way to load another version of HTPC Manager from your docker? It was split and someone added nzbdrone support and the 2 versions haven't been merged yet. Thanks Link to comment
smdion Posted December 18, 2014 Author Share Posted December 18, 2014 I'm planning on adding it in. Just haven't got to it yet. Link to comment
eroz Posted December 18, 2014 Share Posted December 18, 2014 I am new to Dockers so sorry if this question is stupid. Is there a way to load another version of HTPC Manager from your docker? It was split and someone added nzbdrone support and the 2 versions haven't been merged yet. Thanks So you want to run 2 different versions of HTPC Manager? I think you just give them different names and they should both be able to run separately. Link to comment
smdion Posted December 18, 2014 Author Share Posted December 18, 2014 I think he wants a new branch in a docker. Link to comment
mgworek Posted December 18, 2014 Share Posted December 18, 2014 I think he wants a new branch in a docker. Yea. Sorry if I didn't make that clear. Also, thanks for all your dockers and your guide. I jumped from 5.x right into 6 and got dockers running this week with your guide. Link to comment
hellow Posted December 18, 2014 Share Posted December 18, 2014 If you want to have htpc-manager that includes sonarr and other improvements you can use this one https://github.com/Hellowlol/HTPC-Manager. Oh, my, goodness. I could hug you. Your awesome contribution to unraid is more then enough! Thanks for making cool stuff. Link to comment
smdion Posted December 18, 2014 Author Share Posted December 18, 2014 NZBDrone Branch of HTPC Manager is added and XML is updated. Link to comment
Recommended Posts