Knowledgebase

Understanding Container Lifecycle Print

  • 0

From start to removal.

WHAT THE STATES ARE

Created Running Paused Stopped Removed

WHAT HAPPENS ON START

The runtime creates namespaces, applies limits, mounts the filesystem, and executes the command.

WHAT THE COMMAND IS

The entry point, plus any arguments.

WHAT PROCESS IDENTIFIER ONE MEANS

Your process is the first process in its namespace.

WHY THAT MATTERS

That position carries responsibilities: reaping child processes, and handling signals.

WHAT HAPPENS IF IT DOES NOT

Zombie processes accumulate Termination signals are ignored, so shutdown takes the full grace period

WHAT TO DO ABOUT IT

Use an init process as the entry point, or handle signals properly.

WHAT SHELL FORM VERSUS EXECUTABLE FORM CHANGES

Shell form wraps the command in a shell, which becomes process one.

WHAT THAT BREAKS

Signal delivery to your application.

WHAT TO USE

The executable form, so your process receives signals directly.

WHAT HAPPENS ON STOP

A termination signal, a grace period, then a forced kill.

WHAT TO DO IN THAT WINDOW

Stop accepting work, finish what is in progress, exit.

WHAT HAPPENS ON REMOVAL

The writable layer is deleted.

WHAT SURVIVES

Volumes, and anything written outside.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot