Skip to content

Commit 5cfc4c3

Browse files
committed
merge branch 'pr-1169'
Cory Snider (1): config: change prestart hook spec to match reality LGTMs: AkihiroSuda guiseppe cyphar Closes #1169
2 parents 6188d9e + f225699 commit 5cfc4c3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

config.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,9 @@ The [state](runtime.md#state) of the container MUST be passed to hooks over stdi
442442

443443
### <a name="configHooksPrestart" />Prestart
444444

445-
The `prestart` hooks MUST be called after the [`start`](runtime.md#start) operation is called but [before the user-specified program command is executed](runtime.md#lifecycle).
445+
The `prestart` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed.
446446
On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook).
447+
The `prestart` hooks MUST be called before the `createRuntime` hooks.
447448

448449
Note: `prestart` hooks were deprecated in favor of `createRuntime`, `createContainer` and `startContainer` hooks, which allow more granular hook control during the create and start phase.
449450

@@ -461,8 +462,6 @@ On Linux, for example, they are called after the container namespaces are create
461462

462463
The definition of `createRuntime` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace have been created and the mount operations performed. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime.
463464

464-
Note: `runc` originally implemented `prestart` hooks contrary to the spec, namely as part of the `create` operation (instead of during the `start` operation). This incorrect implementation actually corresponds to `createRuntime` hooks. For runtimes that implement the deprecated `prestart` hooks as `createRuntime` hooks, `createRuntime` hooks MUST be called after the `prestart` hooks.
465-
466465
### <a name="configHooksCreateContainer" />CreateContainer Hooks
467466

468467
The `createContainer` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed.

0 commit comments

Comments
 (0)