You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config.md
+19-12Lines changed: 19 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -237,17 +237,29 @@ _Note: For Solaris, uid and gid specify the uid and gid of the process inside th
237
237
## Hooks
238
238
239
239
Lifecycle hooks allow custom events for different points in a container's runtime.
240
-
Presently there are `Prestart`, `Poststart` and `Poststop`.
241
240
242
-
*[`Prestart`](#prestart) is a list of hooks to be run before the container process is executed
243
-
*[`Poststart`](#poststart) is a list of hooks to be run immediately after the container process is started
244
-
*[`Poststop`](#poststop) is a list of hooks to be run after the container process exits
241
+
***`hooks`** (object, optional) MAY contain any of the following properties:
242
+
***`prestart`** (array, optional) is an array of [pre-start hooks](#prestart).
243
+
Entries in the array contain the following properties:
244
+
***`path`** (string, required) contains the location of the executable in the [runtime namespace][runtime-namespace].
245
+
The semantics of the string are specified in a platform-appropriate way.
246
+
On POSIX platforms the semantics are similar 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, optional) contains a list of arguments passed to the executable.
249
+
The semantics of the array are specified in a platform-appropriate way.
250
+
On POSIX platforms the semantics are the same as [IEEE Std 1003.1-2001 `execv`'s *argv*][ieee-1003.1-2001-xsh-exec].
251
+
***`env`** (array of strings, optional) contains a list of variables that will be set in the process's environment prior to execution.
252
+
Elements in the array are specified in a platform-appropriate way.
253
+
On POSIX platforms the strings MUST have the form *name=value*, where *name* MUST NOT contain the character `=`, as outlined in [IEEE Std 1003.1-2001][ieee-1003.1-2001-xbd-c8.1].
254
+
***`timeout`** (int, optional) is the number of seconds before aborting the hook.
255
+
***`poststart`** (array, optional) is an array of [post-start hooks](#poststart).
256
+
Entries in the array have the same schema as pre-start entries.
257
+
***`poststop`** (array, optional) is an array of [post-stop hooks](#poststop).
258
+
Entries in the array have the same schema as pre-start entries.
245
259
246
260
Hooks allow one to run code before/after various lifecycle events of the container.
247
261
Hooks MUST be called in the listed order.
248
-
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.
249
-
250
-
Hook paths are absolute and are executed from the host's filesystem in the [runtime namespace][runtime-namespace].
262
+
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.
251
263
252
264
### Prestart
253
265
@@ -299,11 +311,6 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
299
311
}
300
312
```
301
313
302
-
`path` is required for a hook.
303
-
`args` and `env` are optional.
304
-
`timeout` is the number of seconds before aborting the hook.
305
-
The semantics are the same as `Path`, `Args` and `Env` in [golang Cmd](https://golang.org/pkg/os/exec/#Cmd).
306
-
307
314
## Annotations
308
315
309
316
This OPTIONAL property contains arbitrary metadata for the container.
0 commit comments