docker-library / php

Docker Official Image packaging for PHP
https://php.net
MIT License
3.79k stars 2k forks source link

Implement tini as init-manager (PID1)? #1374

Closed BreiteSeite closed 7 months ago

BreiteSeite commented 1 year ago

Hey,

It seems generally recommended that tini (or any init-manager) is PID1 inside of a container.

I understand, that php-fpm is already some kind of process manager, but i wonder if there might still be edge-cases where a child-process might become a zombie (where tini would help because it would reap the zombie-process as far as i understand). A quick search for "php-fpm zombie" reveals, that this can be an issue (although such search results seem quite old).

For docker, tini is a popular choice which has base-images and alpine packages. It's also already integrated with docker.

So i guess my question is: is there any specific reason the php images are not using tini/a init process? If not, would it make sense to update the images to include tini?

Thanks.

tianon commented 1 year ago

I haven't personally seen FPM create zombies (or seen recent cases of users having it do so), so I'd hesitate to add more overhead/extra tools just on the off chance that it might (users who want that can always add --init / init: true to their deployments to have Docker itself inject tini automatically).

The best way to move forward here would be to find a reliable reproducer that creates zombies :smile:

tianon commented 7 months ago

(Still happy to consider adding something here if someone can find a reliable, minimal reproducer :+1:)