Yelp / dumb-init

A minimal init system for Linux containers
https://engineeringblog.yelp.com/2016/01/dumb-init-an-init-for-docker.html
MIT License
6.83k stars 344 forks source link

[UPDATE]: add a minimal reproducible example #294

Closed codespearhead closed 5 months ago

codespearhead commented 1 year ago

Add a MRE of the problem mentioned in the very first bullet-point of section "Why you need an init system", which can be solved by using dumb-init in the Dockerfile

codespearhead commented 1 year ago

@asottile I updated the previous message for clarity's sake.

polarathene commented 6 months ago

Your minimal example is not really minimal?

Here you go (no need for NodeJS, that JS is effectively just doing sleep, but with a visual countdown):

# CTRL+C will not stop the process exiting the container:
docker run --rm alpine sleep 30

# CTRL+C will now stop the container immediately (`--init` uses built-in `tini`):
docker run --rm -init alpine sleep 30

This is just a signal handling example, not handling zombie processes.