-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S6 no longer in image #1752
Comments
@Joly0 - created a new issue because the discussion is not on topic to the issue you tacked onto . This is not likely to happen, I'm afraid. V6 was a chance to redesign the image from the ground up, and as we no longer need to run multiple binaries, we no longer needed the s6 init system. This also is more in fitting with the "docker way" of doing things, which is one service per container. Take a look at projects such as this one https://github.com/klutchell/balena-pihole, where additional services are added in a stack, rather than injecting them into a single monolithic image. |
Hey @PromoFaux thank your for creating a separate issue. I have looked through various github issues to see, how others are creating their adjusted image and most of them (if not all of them now) create a separate wrapper script, that overwrites the default start.sh script, executes the custom stuff and in the end usually executes the start.sh. Also balena-pihole uses docker-compose, which is not always a good solution in my opinion and is not always available as a choice. While all in all this is a solution one could use and is working, i dislike this approach, because you have to keep track of the upstream (meaning the repo here pi-hole/docker-pi-hole) and check regularly if the entrypoint has changed, which is not super likely but can happen and would probably break the container one created. I do understand the issue regarding one service per container and that this project no longer needs an init system, but it makes it harder to built on top of it and create separate images based on your great work here. Also, and this is only my personal opinion, an init system does not violate the "one service per container" rule, because it is not really a service itself, but part of another service. The init system is only needed to start and gracefully stop the actual services in a way, so no zombie processes are left behind. Even docker themselves recommend using a proper init system. But of course i understand, that an init system would require a slightly larger image from you and would require some more work to keep the init system itself up to date. So while it is ok for me, that this image does no longer have an init system, it would be great to have some kind of extendability. I mentioned already, that the start.sh script could also be extended in a way to load scripts in a specific folder on startup, like linuxserver.io images do https://docs.linuxserver.io/general/container-customization/#custom-scripts atleast that way users could built upon the pi-hole image without interferring with the way it starts and manages itself. |
We could use |
0.1 MB in fact. We did have I wonder if people that wanted to use this container as a base could use the built-in docker support for https://docs.docker.com/reference/cli/docker/container/run/#init |
Hey, i have looked into it and from what i see, tini wont solve the problem as tini only manages one process and docker has no option to "extend" an existing cmd without overwriting it, which would bring us back to the root of my issue. Also afaik tini hasnt been updated for quite a while. From googling about this i found dinit https://gitlab.com/tozd/dinit which is updated and should work for the usecase here, is small in size and also requires minimal changes to the base image, but would allow downstream developers to extend the baseimage without overwriting your entrypoint/cmd. Dinit has a comparision with other init systems on their gitlab page with advantages and disadvantages. Personally i would prefer s6-overlay over anything else, because it is well updated and widely used in the docker community, but it would require some deeper changes and is larger is size fron what i know than most other init systems. Also if wanted, i could create pr's for any init system, so it wouldnt be all your job to handle this, we are still open source community here after all :) |
I'll preface this by saying that this is probably going to sound standoffish, but I truly don't mean it to, I'm just in a bad mood.
One of the beauties of opensource is that if you don't like something the way it is, you can fork and change to suit your needs. I get what you're saying about PRing a change, and appreciate the offer, but if you get hit by a bus the maintenance lands on me/the team to keep something working that to us is unnessacery bloat in the container. A decision was made with the v6 container not to include an init system - we simply don't need one. Adding one in increases complexity and maintenance burden on our part on the small chance that someone downstream wants to build "Pi-hole in docker, except it also has speedtest-cli running inside it" or "Pi-hole docker, but this time it also has Plex Media Server" I'm being facetious with my examples, I know. IMHO, unbound/stubby/cloudflared etc should be set up in a compose stack - in what situations would compose not be available as a choice? |
Unraid. Unraid does not ship with docker-compose, while still being used my hundreds of thousands if not millions of homelabbers. There does exist a plugin for unraid that adds docker-compose, but this is an unofficial third party plugin which does not work together with the app store that unraid also includes. Therefore "combined" images for multiple services is a pretty normal thing in unraid world or images that ship with s6-overlay (mostly by linuxserver.io) which one can extend easily.
I guess, thats the situation we are right now basically, init system is no longer included, i rely on it and i have to bother you guys now with this problem, because i would have to substantially change the way the container is build and have to take care constantly of any changes to the entrypoint/cmd (other than the change from debian to alpine as the base image, which is also a lot of work, but atleast its one-time).
All good, we all have such days :) |
Hey guys, just wanted to ask if anything is going to happen regarding my issue here? Because if not, then this issue can be closed and i will have to find a new different way to build my docker image |
Currently, there is nothing happening in this regard. We are busy with all the fixes and support due to the V6 upgrade. |
Would you accept a PR with my approach like this:
This is a slightly changed start.sh script that adds the "run_custom_init_scripts" function. This function reads the directory "/custom-cont-init.d" for bash scripts, sorts them based on the name (i thought about a naming convention like "10-firstscript.sh; 20-secondscript.sh" and so on), "chmod +x" those scripts and executes them in the background. The output is properly redirected and outputted to the stdout so its visible in docker logs with additional formatting so its visible to the end user which lines in the log come from pihole itself and which ones come from one of the custom scripts. This approach does not interfere with the normal pihole startup at all. So basically mimics the approach linuxserver.io images handle custom scripts in their images |
Potentially, yes. If you PR, please add the meat of it to If you could add some examples and use cases to the PR body - it would be appreciated, so that I know exactly what I'm looking at/getting into when testing |
I have updated the image
i will push my dev brand to my repo later tonight thanks pihole dev for this awesome app |
I've given this a lot of thought over the past couple of days, and at this stage I'm not willing to add this level of functionality to the image. While it may make it slightly easier for users to inject their own scripts, it's not something that is required by the base image. @devzwf appears to already have a POC image (I assume this was the intended target for this discussion ultimately) which has worked around this by making an adjustment to the entrypoint - this is perfectly fine, and also pretty easy to keep in sync with upstream changes as the entrypoing is very very very unlikely to change from I appreciate this may not be exactly what you're looking for - but thanks nonetheless for the conversation and the submission. It was fun to think about! |
Hey @PromoFaux I apprecite the discussion as well. |
Originally posted by @Joly0 in #1701
The text was updated successfully, but these errors were encountered: