-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add hint about Perl5 as PID 1 in the docs #44
Comments
Just to add, |
I believe this is only an issue when using |
mohawk2: no, this is also the case when running without bash, because perl itself doesn't handle signals the way it should when running as PID1 - see the OPs blog post link. While
After this change, the example |
Having run into this issue again from a different way (CircleCI testing) I'm now inclined to add @mephinet's suggestion by default. It should not affect the current Installing the |
Forgot to consider Jessie for the older perls (which does not have both dumb-init or tini packages) so building from source seems the next best option; tini would be preferable in that case. We can also get tini straight off of GitHub releases but since it is small enough (with no other dependency than libc and cmake,) I think we can afford spending a bit more time building it right after the perl build. |
Describe how Perl behaves when being run as PID 1 under containers, particularly on receiving SIGTERM/SIGINT, showing example for explicit signal handling. Ref Perl/docker-perl#44
Erring on the side of caution for now and document the current PID 1 behavior first; while my testing of using tini as default ENTRYPOINT seems to yield no issues across different Perl versions and architectures, it might be better to hold that back for a while until more people are aware and ask about it becoming the default. |
Is there a channel to loudly announce the intention? This is a change intended to reduce surprise, rather than to add features. |
I became first aware of this issue through a blog, so maybe I can just make a post of my own on blogs.perl.org for this. Might also bring it up further to p5p... |
Describe how Perl behaves when being run as PID 1 under containers, particularly on receiving SIGTERM/SIGINT, showing example for explicit signal handling. Ref Perl/docker-perl#44
Describe how Perl behaves when being run as PID 1 under containers, particularly on receiving SIGTERM/SIGINT, showing example for explicit signal handling. Ref Perl/docker-perl#44
This is important for cross-compile builds (e.g. amd64 to arm64) as cpanm/perl won't handle signals without defining them in the code, cf Perl/docker-perl#44. Without this, cross-compiles will appear to stall.
* Add dzil recipe This also serves as a very simple example of using our base perl image. * Dockerfile: a couple more fixes - Check aptfile for readability, not size, so it can be skipped if the file doesn't exist. - Do not auto-remove removable packages; removing them doesn't affect the overall image size anyway, and some packages (like runtime libraries auto-installed by their -dev counterparts) can be inadventently removed and break CPAN modules. * .github/workflows/test.yaml: Test dzil image as well This probably needs its own workflow later, but for now just do a quick build and check using the dzil image. * Dockerfile: invoke dumb-init on cpanm ONBUILD for signals handling This is important for cross-compile builds (e.g. amd64 to arm64) as cpanm/perl won't handle signals without defining them in the code, cf Perl/docker-perl#44. Without this, cross-compiles will appear to stall. * Move apt/cpan setup to script so we can call in sub-images too * dzil build should pull in authordeps and apply Pod::Inherit patch for the DERIV author bundle * Include Pod::Inherit @inc patch * Include CircleCI config as well * Update CircleCI docker orb * Latest orb does not have artifacts path for hadolint * List of dockerfiles now colon-separated * Switch to orb versions of build+publish * Clean up CircleCI config - no point running hadolint everywhere * Apply hadolint recommendations * Filter out some more hadolint checks * Try to set WORKDIR * Attempt to make job steps sequential * Apply `perl` context * CircleCI orb has several bugs, so the current version is not usable * Report $DOCKER_LOGIN to test context-is-broken hypothesis Co-authored-by: Zak B. Elep <[email protected]>
Thanks @diocles for the blog post.
I should probably add a hint for it in https://github.com/docker-library/docs/blob/master/perl/content.md for everyone's future reference, namely to run the container on Docker >= 1.13 with
--init
flag if they need it (or using dumb-init on older Docker versions.)The text was updated successfully, but these errors were encountered: