sameersbn / docker-apt-cacher-ng

Dockerfile to create a Docker container image for Apt-Cacher NG
MIT License
210 stars 72 forks source link

Signal handling #8

Closed Moredread closed 7 years ago

Moredread commented 7 years ago

Currently apt-cacher-ng is run as PID 1. Therefore it doesn't have default signal handlers installed, e.g. as explained in https://github.com/krallin/tini/issues/8

This prevents a clean shutdown of the container with docker stop, and at least makes stopping the container take longer.

To see the effect, start the image with the example config, i.e. docker-compose up, and stop it with CTRL-C. It takes a while to stop it, as docker kills the process only after a timeout.

One option is to use tini, a minimal init implementation, that besides other things, forwards signals correctly.

sameersbn commented 7 years ago

9 uses tini to handle the signal forwarding

sameersbn commented 6 years ago

please note, the latest release removes tini. You need to launch the container with --init flag so that docker daemon injects an init process that has the intended effect of forwarding signals and reaping zombie processes.