Skip to content

Tini

A tiny init process for containers that reaps zombies and forwards signals.

Stars
11.3k
Forks
549
Licence
MIT
Language
C
Last update
1.5 years ago
Type
Dev tool

No commits in over a year — check for forks or alternatives before adopting.

What it is

Tini is a very small program that runs as the first process inside a container. It starts one child program, waits for it to exit, cleans up leftover zombie processes, and passes signals like SIGTERM through to the child. Docker includes it as an option via the --init flag, and people use it to avoid subtle shutdown and process-cleanup problems in containers.

  • Add Tini as the ENTRYPOINT of a Docker image so the application runs as a child of Tini
  • Wrap an existing entrypoint script by placing Tini in front of it
  • Use the -g flag so signals like Ctrl-C reach an entire process group
  • Use the -e flag to remap a child exit code such as 143 to 0 for Java apps

Great for

  • Developers packaging applications into Docker images
  • Teams running containers where processes may leave zombies behind
  • People whose containerized app ignores SIGTERM unless it installs its own handler
  • Operators who want a small, drop-in init without changing their application

Not ideal for

  • Users running full virtual machines or non-containerized systems, since the README says Tini is meant to run in a container
  • Anyone needing a full service manager with multiple supervised services, since Tini only spawns a single child
Step-by-step guide: how to use TiniInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Docker (optional, for container use)

    Debian/Ubuntu package install

    apt-get install tini

    Alpine Linux package install

    apk add --no-cache tini
  2. 2

    Run it

    • Install Tini or download the binary from the releases page
    • Make the binary executable with chmod +x
    • Run Tini before your program: tini -- /your/program arguments
    • In a Dockerfile, set ENTRYPOINT ["/tini", "--"] and CMD to your program
  3. 3

    Get the most out of it

    • Use -v (up to three times) for more verbose output when debugging
    • Set -s or TINI_SUBREAPER if Tini cannot run as PID 1
    • Use -g or TINI_KILL_PROCESS_GROUP so signals reach the whole process group
    • Use -p SIGTERM to set a parent death signal
    • Verify release binaries with the published GPG signature or checksums

Downloads

Strengths

  • Very small: the README says the binary is in the 10KB range, and the static version is under 1M
  • Transparent: images that work without Tini generally work with it unchanged
  • Solves zombie process reaping and default signal handling issues in containers

Trade-offs

  • Only supervises a single child process, so it is not a general service manager
  • Some options (subreaping, process group killing) need extra flags or environment variables to behave as needed

How it compares

ProjectStarsTypeLevelUpdatedBest for
tini (this)11.3kDev toolbeginner1.5 years agoDevelopers packaging applications into Docker images
dockerfiles13.9kCurated listintermediate2.3 years agoDevelopers who want working examples of Dockerfiles for desktop applications run in containers
lvgl25.1kLibraryintermediate4 days agoEngineers adding a touchscreen or display UI to an embedded device
winboat23.3kAppintermediate1 months agoLinux users who need a specific Windows-only application for occasional use
colima31.5kDev toolbeginner23 days agoMac developers who want Docker containers without Docker Desktop
ProxmoxVE30kDev toolbeginner4 days agoHomelab users who run Proxmox VE and want quick installs of common self-hosted services

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.