diff --git a/runtime.md b/runtime.md index fdaf96519..4ceff139a 100644 --- a/runtime.md +++ b/runtime.md @@ -34,22 +34,20 @@ This is provided so that consumers can find the container's configuration and ro ``` ## Lifecycle - -### Create - -Creates the container: file system, namespaces, cgroups, capabilities. - -### Start (process) - -Runs a process in a container. -Can be invoked several times. - -### Stop (process) - -Not sure we need that from runc cli. -Process is killed from the outside. - -This event needs to be captured by runc to run onstop event handlers. +The lifecycle describes the timeline of events that happen from when a container is started to when it is stopped or crashes unexpectedly. + +* OCI compliant runtime is invoked by passing the bundle path as argument. +* The container's runtime environment is created. +* The prestart hooks are invoked in the host environment by the runtime. + If any prestart hook fails, then the container is killed and an error code is returned. +* The user specified process is executed in the container. +* The poststart hooks are invoked in the host environment by the runtime. + If any poststart hook fails, then the container is killed and an error code is returned. +* Additional actions such as pausing the container, checkpointing the container, resuming the container or signaling the container may be performed using the runtime interface. + The container could also error out or crash. +* The container is destroyed by undoing the steps performed during create phase if required. +* The poststop hooks are invoked in the host environment and errors, if any, are logged. +* The state associated with the container is removed and the return code of the container is returned or logged. ## Hooks