Skip to content

Commit 60ecee7

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 60ecee7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

config.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,11 @@ For POSIX platforms, the configuration structure supports `hooks` for configurin
383383
Entries in the array have the same schema as pre-start entries.
384384

385385
Hooks allow users to specify programs to run before or after various lifecycle events.
386+
Hooks are executed on the container host and not in the container.
387+
Therefore, the `path` refers to a path on the host and the execution environment defined in the `process` object does not apply for hooks.
388+
386389
Hooks MUST be called in the listed order.
390+
387391
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.
388392

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

0 commit comments

Comments
 (0)