Skip to content

Instantly share code, notes, and snippets.

@sio
Created February 17, 2020 14:22
Show Gist options
  • Save sio/405bbd4c8bcd3ca7f1a19efabf4ce3dd to your computer and use it in GitHub Desktop.
Save sio/405bbd4c8bcd3ca7f1a19efabf4ce3dd to your computer and use it in GitHub Desktop.
Environment with dysfunctional PID 1 that does not reap zombies
# Environment with dysfunctional PID 1 that does not reap zombies
#
# One zombie process in created automatically upon interactive invocation.
# Use `ps -ef` to see it
FROM python:slim-buster
RUN apt-get update && apt-get -y install procps psmisc
RUN echo "bash -c 'sleep 1 & disown'" > /create-zombie.bash
CMD ["python", "-c", "import pty; pty.spawn(['bash', '--init-file', '/create-zombie.bash'])"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment