@@ -287,19 +287,24 @@ For Windows based systems the user structure has the following fields:
287287
288288## Hooks
289289
290- ** ` hooks ` ** (object, OPTIONAL) configures callbacks for container lifecycle events.
291290Lifecycle hooks allow custom events for different points in a container's runtime.
292- Presently there are ` Prestart ` , ` Poststart ` and ` Poststop ` .
293291
294- * [ ` Prestart ` ] ( #prestart ) is a list of hooks to be run before the container process is executed
295- * [ ` Poststart ` ] ( #poststart ) is a list of hooks to be run immediately after the container process is started
296- * [ ` Poststop ` ] ( #poststop ) is a list of hooks to be run after the container process exits
292+ * ** ` hooks ` ** (object, OPTIONAL) MAY contain any of the following properties:
293+ * ** ` prestart ` ** (array, OPTIONAL) is an array of [ pre-start hooks] ( #prestart ) .
294+ Entries in the array contain the following properties:
295+ * ** ` path ` ** (string, REQUIRED) with similar semantics to [ IEEE Std 1003.1-2001 ` execv ` 's * path* ] [ ieee-1003.1-2001-xsh-exec ] .
296+ This specification extends the IEEE standard in that ** ` path ` ** MUST be absolute.
297+ * ** ` args ` ** (array of strings, REQUIRED) with the same semantics as [ IEEE Std 1003.1-2001 ` execv ` 's * argv* ] [ ieee-1003.1-2001-xsh-exec ] .
298+ * ** ` env ` ** (array of strings, OPTIONAL) with the same semantics as [ IEEE Std 1003.1-2001's ` environ ` ] [ ieee-1003.1-2001-xbd-c8.1 ] .
299+ * ** ` timeout ` ** (int, OPTIONAL) is the number of seconds before aborting the hook.
300+ * ** ` poststart ` ** (array, OPTIONAL) is an array of [ post-start hooks] ( #poststart ) .
301+ Entries in the array have the same schema as pre-start entries.
302+ * ** ` poststop ` ** (array, OPTIONAL) is an array of [ post-stop hooks] ( #poststop ) .
303+ Entries in the array have the same schema as pre-start entries.
297304
298305Hooks allow one to run code before/after various lifecycle events of the container.
299306Hooks MUST be called in the listed order.
300- 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.
301-
302- Hook paths are absolute and are executed from the host's filesystem in the [ runtime namespace] [ runtime-namespace ] .
307+ 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.
303308
304309### Prestart
305310
@@ -351,11 +356,6 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
351356 }
352357```
353358
354- ` path ` is REQUIRED for a hook.
355- ` args ` and ` env ` are OPTIONAL.
356- ` timeout ` is the number of seconds before aborting the hook.
357- The semantics are the same as ` Path ` , ` Args ` and ` Env ` in [ golang Cmd] ( https://golang.org/pkg/os/exec/#Cmd ) .
358-
359359## Annotations
360360
361361** ` annotations ` ** (object, OPTIONAL) contains arbitrary metadata for the container.
0 commit comments