Skip to content

Fix killing of unresponsive containers by adding init process

Warren Gifford requested to merge mrn/fix-killing-of-containers into main

Created by: mrnugget

Fixes https://github.com/sourcegraph/sourcegraph/issues/15314

This adds the --init flag to the docker run command so that the entrypoint process (bash in our case) is started by a init process. That fixes the behaviour of the interrupt signal simply having no effect.

From what I could gather that's because PID 1 (which is the --entrypoint in a Docker container) is protected and cannot be killed. But --init is given the PID1 is an init process, which forwards the signal to our entrypoint and kills it, exiting afterwards.

Resources:

Merge request reports

Loading