Skip to content

Commit 52a5199

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 83914ed commit 52a5199

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
@@ -206,6 +206,43 @@ A container joins an existing [UTS namespace](config-linux.md#namespaces) on Lin
206206

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

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

0 commit comments

Comments
 (0)