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
+18-19Lines changed: 18 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,12 +125,9 @@ See links for details about [mountvol](http://ss64.com/nt/mountvol.html) and [Se
125
125
***`width`** (uint, REQUIRED)
126
126
***`cwd`** (string, REQUIRED) is the working directory that will be set for the executable.
127
127
This value MUST be an absolute path.
128
-
***`env`** (array of strings, OPTIONAL) contains a list of variables that will be set in the process's environment prior to execution.
129
-
Elements in the array are specified as Strings in the form "KEY=value".
130
-
The left hand side MUST consist solely of letters, digits, and underscores `_` as outlined in [IEEE Std 1003.1-2001](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html).
131
-
***`args`** (array of strings, REQUIRED) executable to launch and any flags as an array.
132
-
The executable is the first element and MUST be available at the given path inside of the rootfs.
133
-
If the executable path is not an absolute path then the search $PATH is interpreted to find the executable.
128
+
***`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2001's `environ`][ieee-1003.1-2001-xbd-c8.1].
129
+
***`args`** (array of strings, REQUIRED) with similar semantics to [IEEE Std 1003.1-2001 `execvp`'s *argv*][ieee-1003.1-2001-xsh-exec].
130
+
This specification extends the IEEE standard in that at least one entry is REQUIRED, and that entry is used with the same semantics as `execvp`'s *file*.
134
131
135
132
For Linux-based systems the process structure supports the following process specific fields:
136
133
@@ -313,19 +310,24 @@ For Windows based systems the user structure has the following fields:
313
310
314
311
## Hooks
315
312
316
-
**`hooks`** (object, OPTIONAL) configures callbacks for container lifecycle events.
317
313
Lifecycle hooks allow custom events for different points in a container's runtime.
318
-
Presently there are `Prestart`, `Poststart` and `Poststop`.
319
314
320
-
*[`Prestart`](#prestart) is a list of hooks to be run before the container process is executed
321
-
*[`Poststart`](#poststart) is a list of hooks to be run immediately after the container process is started
322
-
*[`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.
323
327
324
328
Hooks allow one to run programs before/after various lifecycle events of the container.
325
329
Hooks MUST be called in the listed order.
326
-
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.
327
-
328
-
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.
329
331
330
332
### Prestart
331
333
@@ -377,11 +379,6 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
377
379
}
378
380
```
379
381
380
-
`path` is REQUIRED for a hook.
381
-
`args` and `env` are OPTIONAL.
382
-
`timeout` is the number of seconds before aborting the hook.
383
-
The semantics are the same as `Path`, `Args` and `Env` in [golang Cmd](https://golang.org/pkg/os/exec/#Cmd).
384
-
385
382
## Annotations
386
383
387
384
**`annotations`** (object, OPTIONAL) contains arbitrary metadata for the container.
@@ -762,6 +759,8 @@ Here is a full example `config.json` for reference.
0 commit comments