Docker Community Forums

Share and learn in the Docker community.

Launching run with --init does not give the expected behaviour (that of using tini)


(Kellens) #1

I’m running a CI service for an open source project that occasionally needs to kill builds. I’m running into a problem that zombie containers stay present on the build servers, and these containers use a lot of resources which will eventually cause issues for subsequent builds. I’ve tried using tini in the hopes that signals from parent processes (such as SIGKILL) will be passed to their children. This actually works quite well. The process tree that I would expect to be killed does in fact get killed.

The question I have is that based on the documentation of the ‘–init’ parameter, using it should be the equivalent of using tini. For me this is not the case both in terms of zombie containers, and sub-reaping. With the --init param I get the same default behaviour (zombie containers, uncleaned child processes).

For reference here’s an example Dockerfile with tini:

and w/o: