@@ -310,19 +310,24 @@ For Windows based systems the user structure has the following fields:
310310
311311## Hooks
312312
313- ** ` hooks ` ** (object, OPTIONAL) configures callbacks for container lifecycle events.
314313Lifecycle hooks allow custom events for different points in a container's runtime.
315- Presently there are ` Prestart ` , ` Poststart ` and ` Poststop ` .
316314
317- * [ ` Prestart ` ] ( #prestart ) is a list of hooks to be run before the container process is executed
318- * [ ` Poststart ` ] ( #poststart ) is a list of hooks to be run immediately after the container process is started
319- * [ ` Poststop ` ] ( #poststop ) is a list of hooks to be run after the container process exits
315+ * ** ` hooks ` ** (object, OPTIONAL) MAY contain any of the following properties:
316+ * ** ` prestart ` ** (array, OPTIONAL) is an array of [ pre-start hooks] ( #prestart ) .
317+ Entries in the array contain the following properties:
318+ * ** ` path ` ** (string, REQUIRED) with similar semantics to [ IEEE Std 1003.1-2001 ` execv ` 's * path* ] [ ieee-1003.1-2001-xsh-exec ] .
319+ This specification extends the IEEE standard in that ** ` path ` ** MUST be absolute.
320+ * ** ` args ` ** (array of strings, REQUIRED) with the same semantics as [ IEEE Std 1003.1-2001 ` execv ` 's * argv* ] [ ieee-1003.1-2001-xsh-exec ] .
321+ * ** ` env ` ** (array of strings, OPTIONAL) with the same semantics as [ IEEE Std 1003.1-2001's ` environ ` ] [ ieee-1003.1-2001-xbd-c8.1 ] .
322+ * ** ` timeout ` ** (int, OPTIONAL) is the number of seconds before aborting the hook.
323+ * ** ` poststart ` ** (array, OPTIONAL) is an array of [ post-start hooks] ( #poststart ) .
324+ Entries in the array have the same schema as pre-start entries.
325+ * ** ` poststop ` ** (array, OPTIONAL) is an array of [ post-stop hooks] ( #poststop ) .
326+ Entries in the array have the same schema as pre-start entries.
320327
321328Hooks allow one to run programs before/after various lifecycle events of the container.
322329Hooks MUST be called in the listed order.
323- The state of the container is passed to the hooks over stdin, so the hooks could get the information they need to do their work.
324-
325- Hook paths are absolute and are executed from the host's filesystem in the [ runtime namespace] [ runtime-namespace ] .
330+ The [ state] ( runtime.md#state ) of the container is passed to the hooks over stdin, so the hooks could get the information they need to do their work.
326331
327332### Prestart
328333
@@ -374,11 +379,6 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
374379 }
375380```
376381
377- ` path ` is REQUIRED for a hook.
378- ` args ` and ` env ` are OPTIONAL.
379- ` timeout ` is the number of seconds before aborting the hook.
380- The semantics are the same as ` Path ` , ` Args ` and ` Env ` in [ golang Cmd] ( https://golang.org/pkg/os/exec/#Cmd ) .
381-
382382## Annotations
383383
384384** ` annotations ` ** (object, OPTIONAL) contains arbitrary metadata for the container.
0 commit comments