Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
"poststart": [
{
"path": "/usr/bin/notify-start"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding that line will require a comma on the end of this line

"timeout": 5
}
],
"poststop": [
Expand All @@ -239,6 +240,7 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin

`path` is required for a hook.
`args` and `env` are optional.
`timeout` is the number of seconds before aborting the hook.
The semantics are the same as `Path`, `Args` and `Env` in [golang Cmd](https://golang.org/pkg/os/exec/#Cmd).

## Annotations
Expand Down
7 changes: 4 additions & 3 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ type Mount struct {

// Hook specifies a command that is run at a particular event in the lifecycle of a container
type Hook struct {
Path string `json:"path"`
Args []string `json:"args,omitempty"`
Env []string `json:"env,omitempty"`
Path string `json:"path"`
Args []string `json:"args,omitempty"`
Env []string `json:"env,omitempty"`
Timeout *int `json:"timeout,omitempty"`
}

// Hooks for container setup and teardown
Expand Down