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: config.go
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -56,3 +56,15 @@ type MountPoint struct {
56
56
// Path specifies the path of the mount. The path and child directories MUST exist, a runtime MUST NOT create directories automatically to a mount point.
57
57
Pathstring`json:"path"`
58
58
}
59
+
60
+
// State holds information about the runtime state of the container.
61
+
typeStatestruct {
62
+
// Version is the version of the specification that is supported.
63
+
Versionstring`json:"version"`
64
+
// ID is the container ID
65
+
IDstring`json:"id"`
66
+
// Pid is the process id for the container's main process.
67
+
Pidint`json:"pid"`
68
+
// Root is the path to the container's bundle directory.
Copy file name to clipboardExpand all lines: runtime.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,34 @@
1
1
# Runtime and Lifecycle
2
2
3
+
## State
4
+
5
+
The runtime state for a container is persisted on disk so that external tools can consume and act on this information.
6
+
The runtime state is stored in a JSON encoded file.
7
+
It is recommended that this file is stored in a temporary filesystem so that it can be removed on a system reboot.
8
+
On Linux based systems the state information should be stored in `/run/oci/containers`.
9
+
The directory structure for a container is `/run/oci/containers/<containerID>/state.json`.
10
+
By providing a default location that container state is stored external applications can find all containers running on a system.
11
+
12
+
***version** (string) Version of the OCI specification used when creating the container.
13
+
***id** (string) ID is the container's ID.
14
+
***pid** (int) Pid is the ID of the main process within the container.
15
+
***root** (string) Root is the path to the container's bundle directory.
16
+
17
+
The ID is provided in the state because hooks will be executed with the state as the payload.
18
+
This allows the hook to perform clean and teardown logic after the runtime destroys its own state.
19
+
20
+
The root directory to the bundle is provided in the state so that consumers can find the container's configuration and rootfs where it is located on the host's filesystem.
0 commit comments