Skip to content

Commit 841e0e8

Browse files
committed
config: Clarify execution environment for hooks
The spec didn't say whether the hooks are executed in the container environment or not (in Linux namespaces, with cgroups and rlimits applied). In rkt, hooks are executed in the container environment. In runc, hooks are executed outside of the container environment. The example with setting up the network namespace in "prestart" suggests that the command is generic and does not have to exist in the container rootfs. So I assume the spec was meant to say hooks are executed outside of the container environment. Signed-off-by: Alban Crequy <[email protected]>
1 parent fa4b36a commit 841e0e8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ For POSIX platforms, the configuration structure supports `hooks` for configurin
373373
Entries in the array contain the following properties:
374374
* **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec].
375375
This specification extends the IEEE standard in that **`path`** MUST be absolute.
376+
Runtimes MUST resolve this value in the [runtime mount namespace](glossary.md#runtime-namespace).
376377
* **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec].
377378
* **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1].
378379
* **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook.
@@ -384,6 +385,7 @@ For POSIX platforms, the configuration structure supports `hooks` for configurin
384385

385386
Hooks allow users to specify programs to run before or after various lifecycle events.
386387
Hooks MUST be called in the listed order.
388+
Hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace).
387389
The [state](runtime.md#state) of the container MUST be passed to hooks over stdin so that they may do work appropriate to the current state of the container.
388390

389391
### <a name="configHooksPrestart" />Prestart

0 commit comments

Comments
 (0)