Tutorial: Move Linuxserver.io Image to addon #398
Replies: 3 comments 6 replies
-
Good idea, I'll write a bit when I'll have time, thanks. |
Beta Was this translation helpful? Give feedback.
-
Here is something I wrote in the past, I'll write a guide when I'll have more time :
|
Beta Was this translation helpful? Give feedback.
-
This tutorial is based on a linuxserver image, but the basic principle are transposable to other high quality images from Dockerhub. For this example, we'll use this container : https://hub.docker.com/r/linuxserver/piwigo. 1. Build the base addon structureCreate a repository on github based on HA provided example 2. Identify a suitable already published image
3. Adapt for HA usage3.1. Define the fixed parameters for your addonBy looking at the docker-compose provided by the addon, you can see the most important information to run the addon. You can get several information from the docker-compose :
3.1. Define the variables parameters for your addonHA does not support passing environment variables dynamically. All environment options need to be defined in a fixed manner either in the Dockerfile (through ENV command) or in the config.json environment key. This can be done in two ways. For example, linuxserver images have a dynamic env variable for setting PUID and GUID.
This code must be added in the same bash session as where the app is run. For example, either you have a run.sh file where you export variables, then you execute the app, or more probably you have a separate script (in /etc/cont-init.d probably) and services (in /etc/services.d). What you can do is therefore put the export in those files, for example with :
3.3. Create your DockerfileFollow the official guide. Ensure to add instructions to modify files for dynamic environment setting, and add apps if needed. Add label. 3.4. Ensure data remanenceCreate folders on your local system, and use symlink so that the app will use these folders instead of its default ones. Script example 3.5. Add any other scriptsS6 based images get any scripts in /etc/cont-initi.d and /etc/services.d and execute them (if they have execute access). 4. Add codenotary signatureOptional, see here for documentation : https://developers.home-assistant.io/docs/add-ons/security?_highlight=codenotary#codenotary-cas 5. Add auto build imagesOptional, see here for documentation : https://github.com/home-assistant/builder |
Beta Was this translation helpful? Give feedback.
-
Hey there,
i was thinking about cnverting some images from linuxserver to home assistant addons myself, but i don't know how. Maybe it would be a good idea if you write up a tutorial so that more people can port images and contribute them to this repo.
Beta Was this translation helpful? Give feedback.
All reactions