Python scripts only spawn zombie processes in Docker

Python scripts only spawn zombie processes in Docker … here is a solution to the problem.

Python scripts only spawn zombie processes in Docker

I have quite a complicated setup

But long story short – everything works fine on my local Ubuntu (17.10) desktop, but when running in Docker (18.03.0-ce) via docker-compose(1.18.0) in Docker (18.03.0-ce) (configuration version 3.3, some details here< a href="https://github.com/miyakogi/pyppeteer/issues/14" rel="noreferrer noopener nofollow" > https://github.com/miyakogi/pyppeteer/issues/14) It swells with the zombie chrome process spawned by Python.

Any idea why this happens and how to deal with it?

enter image description here

Solution

Try installing dumb-init:https://github.com/Yelp/dumb-init (available in alpine and debian) In your container and use it as an entry point (read more here: https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/)

Related Problems and Solutions