Skip to content

Commit eeacccd

Browse files
committed
runtime: Clarify cgroup cleanup on 'delete'
Expanding on the creater-owns-the-resource cases from the previous commit. Signed-off-by: W. Trevor King <[email protected]>
1 parent 01c004c commit eeacccd

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

runtime.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,43 @@ A container joins an existing [UTS namespace](config-linux.md#namespaces) on Lin
209209

210210
When the example container is deleted, neither removing the preexisting UTS namespace nor undoing the hostname change are allowed.
211211

212+
##### Joining cgroups (Linux)
213+
214+
A container joins an existing [cgroup](config-linux.md#control-groups) on Linux and changes a [memory limit](config.md#memory) with the following [configuration](config.md):
215+
216+
```json
217+
{
218+
"ociVersion": "1.0.0-rc3",
219+
"platform": {
220+
"os": "linux",
221+
"arch": "amd64"
222+
},
223+
"process": {
224+
"cwd": "/",
225+
"args": [
226+
"sh"
227+
],
228+
"user": {
229+
"uid": 1,
230+
"gid": 1
231+
}
232+
},
233+
"root": {
234+
"path": "rootfs"
235+
},
236+
"linux": {
237+
"cgroupsPath": "/some/existing/container",
238+
"resources": {
239+
"memory": {
240+
"limit": 100000
241+
}
242+
}
243+
}
244+
}
245+
```
246+
247+
When the example container is deleted, neither removing the preexisting cgroup not undoing the memory limit change are allowed.
248+
212249
## Hooks
213250
Many of the operations specified in this specification have "hooks" that allow for additional actions to be taken before or after each operation.
214251
See [runtime configuration for hooks](./config.md#hooks) for more information.

0 commit comments

Comments
 (0)