Skip to content

Commit 0e9183f

Browse files
committed
hooks: start with pre-start and post-stop hooks.
Signed-off-by: Mrunal Patel <[email protected]>
1 parent 25e30fe commit 0e9183f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

runtime.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,20 @@ Runs a process in a container. Can be invoked several times.
1515
Not sure we need that from oc cli. Process is killed from the outside.
1616

1717
This event needs to be captured by oc to run onstop event handlers.
18+
19+
## Hooks
20+
Hooks allows one to run code before/after various lifecycle events of the container. The state of the container is passed to the hooks over a well-known fd, so the hooks could get the information they need to do their work.
21+
22+
### Pre-start
23+
The pre-start hook is called before the container process is started. It provides an opportunity to customize the container. In Linux, for e.g., the network namespace could be configured in this hook.
24+
25+
### Post-stop
26+
The post-stop hook is called after the container process is stopped. Cleanup or debugging could be performed in such ahook.
27+
28+
```
29+
"hooks" : {
30+
"pre-start": "/path/to/pre-start-hook",
31+
"post-stop": "/path/to/post-stop-hook"
32+
}
33+
```
34+

0 commit comments

Comments
 (0)