Docker init

Updated: 08 May 2023

Run an init inside a container which forwards signals and reaps processes. Configure in a Dockerfile

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        tini \
    && rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["/usr/bin/tini", "--"]

or docker-compose.yml

    image: alpine:latest
    init: true

Tini is the simplest init you could think of. All Tini does is spawn a single child (Tini is meant to be run in a container), and wait for it to exit all the while reaping zombies and performing signal forwarding.

Leave a comment