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: README.md
+1-6Lines changed: 1 addition & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,14 +34,9 @@ To provide context for users the following section gives example use cases for e
34
34
#### Application Bundle Builders
35
35
36
36
Application bundle builders can create a [bundle](bundle.md) directory that includes all of the files required for launching an application as a container.
37
-
The bundle contains an OCI [configuration file](config.md) where the builder can specify host-independent details such as [which executable to launch](config.md#process-configuration) and host-specific settings such as [mount](config.md#mounts) locations, [hook](config.md#hooks) paths, Linux [namespaces](config-linux.md#namespaces) and [cgroups](config-linux.md#control-groups).
37
+
The bundle contains an OCI [configuration file](config.md) where the builder can specify host-independent details such as [which executable to launch](config.md#process-configuration) and host-specific settings such as [mount](config.md#mounts) locations, Linux [namespaces](config-linux.md#namespaces) and [cgroups](config-linux.md#control-groups).
38
38
Because the configuration includes host-specific settings, application bundle directories copied between two hosts may require configuration adjustments.
39
39
40
-
#### Hook Developers
41
-
42
-
[Hook](config.md#hooks) developers can extend the functionality of an OCI-compliant runtime by hooking into a container's lifecycle with an external application.
43
-
Example use cases include sophisticated network configuration, volume garbage collection, etc.
44
-
45
40
#### Runtime Developers
46
41
47
42
Runtime developers can build runtime implementations that run OCI-compliant bundles and container configuration, containing low-level OS and host specific details, on a particular platform.
Copy file name to clipboardExpand all lines: config.md
-103Lines changed: 0 additions & 103 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -235,76 +235,6 @@ _Note: For Solaris, uid and gid specify the uid and gid of the process inside th
235
235
}
236
236
```
237
237
238
-
## Hooks
239
-
240
-
Lifecycle hooks allow custom events for different points in a container's runtime.
241
-
Presently there are `Prestart`, `Poststart` and `Poststop`.
242
-
243
-
*[`Prestart`](#prestart) is a list of hooks to be run before the container process is executed
244
-
*[`Poststart`](#poststart) is a list of hooks to be run immediately after the container process is started
245
-
*[`Poststop`](#poststop) is a list of hooks to be run after the container process exits
246
-
247
-
Hooks allow one to run code before/after various lifecycle events of the container.
248
-
Hooks MUST be called in the listed order.
249
-
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.
250
-
251
-
Hook paths are absolute and are executed from the host's filesystem in the [runtime namespace][runtime-namespace].
252
-
253
-
### Prestart
254
-
255
-
The pre-start hooks are called after the container process is spawned, but before the user supplied command is executed.
256
-
They are called after the container namespaces are created on Linux, so they provide an opportunity to customize the container.
257
-
In Linux, for e.g., the network namespace could be configured in this hook.
258
-
259
-
If a hook returns a non-zero exit code, then an error including the exit code and the stderr is returned to the caller and the container is torn down.
260
-
261
-
### Poststart
262
-
263
-
The post-start hooks are called after the user process is started.
264
-
For example this hook can notify user that real process is spawned.
265
-
266
-
If a hook returns a non-zero exit code, then an error is logged and the remaining hooks are executed.
267
-
268
-
### Poststop
269
-
270
-
The post-stop hooks are called after the container process is stopped.
271
-
Cleanup or debugging could be performed in such a hook.
272
-
If a hook returns a non-zero exit code, then an error is logged and the remaining hooks are executed.
273
-
274
-
### Example
275
-
276
-
```json
277
-
"hooks" : {
278
-
"prestart": [
279
-
{
280
-
"path": "/usr/bin/fix-mounts",
281
-
"args": ["fix-mounts", "arg1", "arg2"],
282
-
"env": [ "key1=value1"]
283
-
},
284
-
{
285
-
"path": "/usr/bin/setup-network"
286
-
}
287
-
],
288
-
"poststart": [
289
-
{
290
-
"path": "/usr/bin/notify-start",
291
-
"timeout": 5
292
-
}
293
-
],
294
-
"poststop": [
295
-
{
296
-
"path": "/usr/sbin/cleanup.sh",
297
-
"args": ["cleanup.sh", "-f"]
298
-
}
299
-
]
300
-
}
301
-
```
302
-
303
-
`path` is required for a hook.
304
-
`args` and `env` are optional.
305
-
`timeout` is the number of seconds before aborting the hook.
306
-
The semantics are the same as `Path`, `Args` and `Env` in [golang Cmd](https://golang.org/pkg/os/exec/#Cmd).
307
-
308
238
## Annotations
309
239
310
240
This OPTIONAL property contains arbitrary metadata for the container.
@@ -448,39 +378,6 @@ Here is a full example `config.json` for reference.
0 commit comments