@@ -34,22 +34,24 @@ This is provided so that consumers can find the container's configuration and ro
3434```
3535
3636## Lifecycle
37-
38- ### Create
39-
40- Creates the container: file system, namespaces, cgroups, capabilities.
41-
42- ### Start (process)
43-
44- Runs a process in a container.
45- Can be invoked several times.
46-
47- ### Stop (process)
48-
49- Not sure we need that from runc cli.
50- Process is killed from the outside.
51-
52- This event needs to be captured by runc to run onstop event handlers.
37+ The lifecycle describes the timeline of events that happen from when a container is created to when it ceases to exist.
38+
39+ 1 . OCI compliant runtime is invoked by passing the bundle path as argument.
40+ 2 . The container's runtime environment is created according to the configuration in config.json.
41+ Any updates to config.json after container is running do not affect the container.
42+ 3 . The container's state.json file is written to the filesystem under /run/opencontainer/<runtime >/containers/<id >/.
43+ 4 . The prestart hooks are invoked by the runtime.
44+ If any prestart hook fails, then the container is stopped and the lifecycle continues at step 8.
45+ 5 . The user specified process is executed in the container.
46+ 6 . The poststart hooks are invoked by the runtime.
47+ If any poststart hook fails, then the container is stopped and the lifecycle continues at step 8.
48+ 7 . Additional actions such as pausing the container, resuming the container or signaling the container may be performed using the runtime interface.
49+ The container could also error out or crash.
50+ 8 . The container is destroyed by undoing the steps performed during create phase (step 2).
51+ 9 . The poststop hooks are invoked by the runtime and errors, if any, are logged.
52+ 10 . The state.json file associated with the container is removed and the return code of the container's user specified process is returned or logged.
53+
54+ Note: The lifecycle is a WIP and it will evolve as we have more use cases and more information on the viability of a separate create phase.
5355
5456## Hooks
5557
0 commit comments