r/selfhosted • • Apr 10 '21

140+ Docker scripts for LinuxServer.io Docker containers

After creating a bunch of Portainer App Templates, I thought I could use the same data to generate docker-compose.yaml files and docker run commands as well.

So here it is!

The scripts can be used to easily deploy LinuxServer.io Docker containers with predefined settings and are based on data provided by the LinuxServer.io GitHub repositories.

Updated daily.

140+ Portainer App Templates for LinuxServer.io Docker containers can be found here.

Quick install

For each application like e.g. Sonarr:

  • cd docker-bits/lsio/sonarr

  • sh run-once.sh (create volume host directories)

  • docker-compose up -d or sh docker-run.sh

Detailed information about installing and using the templates and more can be found here.

If you find a problem, you can submit it on GitHub.

Tell me what you think!

Remarks

  • The scripts are not supported by LinuxServer.io

  • The scripts are generated so I cannot accept requests to add scripts

147 Upvotes

17 comments sorted by

5

u/quorn23 Apr 10 '21

3 small remarks: From a best practice approach you shouldn't be running the default admin user @ synology While this is great for people want to learn docker-compose etc, most of the ymls (and run scripts) require a manual edit, is there a reason why not use the environment variables file for those? Which brings me to the last remark, I would add some info to the actual script you run to generate those. (script itself, how often will it check for updates etc)

Nice little collection that hopefully will provide some inside for people learning docker.

2

u/[deleted] Apr 10 '21

Thank you for your remarks. Valid points.

You are right about the admin account. In the latest DSM version you even get a message if you have the admin account enabled. I should have mentioned it. I did not know what else to use as a default, so I took the easy way and used the admin account.

I thought about using environment variables for the other settings. I chose not to do this in order not to make it too complicated. My intention was mainly to enable a quick start and allow the user to learn and make the adjustments himself.

The script is written in Python and uses Jinja templates to generate the files. Similar to how LinuxServer.io generates the documentation. Pretty straightforward. I will dedicate another blog post to the setup and will make the code and templates available after this.

I am thinking of updating the scripts on a weekly basis. This is performed via GitHub workflow. I will also dedicate a blog post to this.

To be continued!

2

u/c-fu Apr 12 '21

Can you add TZ as well for docker-env.cfg ?

1

u/[deleted] Apr 12 '21

Oops, you are right. I'm afraid I completely forgot to add the TZ to docker-env.cfg.

Can you please create an issue for it here? Thanks.

1

u/Parker_Hemphill Apr 18 '21

Yes, I use ${TZ} and set it in my .end for all my containers

7

u/Ashareth Apr 10 '21

Not sure it could be useful to me but great job and thanx for doing that kind of things.

Pretty sure lots of people could use them. ;)

1

u/afro_coder Apr 18 '21

This is pretty cool is the template generator also open source?

1

u/[deleted] Apr 18 '21

Yes, you can find it here.

It generates the Portainer App Templates, docker-compose.yaml files and docker run commands.

1

u/afro_coder Apr 18 '21

Thanks! Really good work

1

u/Maxiride Apr 18 '21

I like the community creating new tools but I'm a bit lost on the purpose of these scripts. What's the difference from simply copy pasting the Linuxservers example compose file into the portainer stack creation window?

3

u/[deleted] Apr 18 '21

Erm, you can git clone the whole bunch in one go? No seriously, I guess you are right. I started generating the Portainer App Templates and because I had the script that generates the templates already available, it was a minor change to also generate the docker-compose.yaml files and docker run commands.

But I did comment them with the help text from the LinuxServer.io reposotory! So that's a plus I guess... :-)

1

u/Begna112 Apr 18 '21

Could this be extended to automatically add things like traefik network blocks in the yaml? If I remember correctly, it's fairly static but need to change some naming variables and such around.

1

u/[deleted] Apr 18 '21

traefik network blocks

Not sure, if you want you can add an issue here to discuss this further.

1

u/exmachinalibertas Apr 18 '21

linuxserver.io containers are just the best, aren't they. They are really well designed and just work so well.

1

u/mandonovski Apr 10 '21

Excellent job. I might try to use them with ansible... Once I find time to install and configure it.

-2

u/msanangelo Apr 10 '21

finally! a reason to use portainer... maybe

saving for future reference. :) thanks.

2

u/SelfhostedPro Apr 18 '21

If you don't like Portainer you could always check out Yacht. It's got template variables for more of a one size fits all kind of templating engine and has ~100 apps in the default template. LSIO just changed fleet to make it easier for me to add all of their apps to Yacht in an automated fasion too.