@@ -239,17 +239,23 @@ _Note: For Solaris, uid and gid specify the uid and gid of the process inside th
239239## Hooks
240240
241241Lifecycle hooks allow custom events for different points in a container's runtime.
242- Presently there are ` Prestart ` , ` Poststart ` and ` Poststop ` .
243242
244- * [ ` Prestart ` ] ( #prestart ) is a list of hooks to be run before the container process is executed
245- * [ ` Poststart ` ] ( #poststart ) is a list of hooks to be run immediately after the container process is started
246- * [ ` Poststop ` ] ( #poststop ) is a list of hooks to be run after the container process exits
243+ * ** ` hooks ` ** (object, optional) MAY contain any of the following properties:
244+ * ** ` prestart ` ** (array, optional) is an array of [ pre-start hooks] ( #prestart ) .
245+ Entries in the array contain the following properties:
246+ * ** ` path ` ** (string, required) with similar semantics to [ IEEE Std 1003.1-2001 ` execv ` 's * path* ] [ ieee-1003.1-2001-xsh-exec ] .
247+ This specification extends the IEEE standard in that ** ` path ` ** MUST be absolute.
248+ * ** ` args ` ** (array of strings, required) with the same semantics as [ IEEE Std 1003.1-2001 ` execv ` 's * argv* ] [ ieee-1003.1-2001-xsh-exec ] .
249+ * ** ` env ` ** (array of strings, optional) with the same semantics as [ IEEE Std 1003.1-2001's ` environ ` ] [ ieee-1003.1-2001-xbd-c8.1 ] .
250+ * ** ` timeout ` ** (int, optional) is the number of seconds before aborting the hook.
251+ * ** ` poststart ` ** (array, optional) is an array of [ post-start hooks] ( #poststart ) .
252+ Entries in the array have the same schema as pre-start entries.
253+ * ** ` poststop ` ** (array, optional) is an array of [ post-stop hooks] ( #poststop ) .
254+ Entries in the array have the same schema as pre-start entries.
247255
248256Hooks allow one to run code before/after various lifecycle events of the container.
249257Hooks MUST be called in the listed order.
250- 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.
251-
252- Hook paths are absolute and are executed from the host's filesystem in the [ runtime namespace] [ runtime-namespace ] .
258+ 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.
253259
254260### Prestart
255261
@@ -301,11 +307,6 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
301307 }
302308```
303309
304- ` path ` is required for a hook.
305- ` args ` and ` env ` are optional.
306- ` timeout ` is the number of seconds before aborting the hook.
307- The semantics are the same as ` Path ` , ` Args ` and ` Env ` in [ golang Cmd] ( https://golang.org/pkg/os/exec/#Cmd ) .
308-
309310## Annotations
310311
311312This OPTIONAL property contains arbitrary metadata for the container.
0 commit comments