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
This property was initially Linux-specific. 718f9f3 (minor narrative
cleanup regarding config compatibility, 2017-01-30, #673) removed the
Linux restriction, but the rlimit concept is from POSIX and Windows
doesn't support it [1]. This commit adds new subsections for the
POSIX-specific and Linux-specific process entries (to match the
approach we currently use for process.user), and punts to POSIX for
the Solaris values and compliance testing approach. If/when we get a
Solaris-specific doc for valid values, we can replace the POSIX punt
there, but we probably want to continue punting to POSIX for
getrlimit(3)-based compliance testing.
I've renamed the overly-specific LinuxRlimit to POSIXRlimit. We could
use the generic Rlimit, but then we'd be stuck if/when Windows adds
support for some rlimit-like thing that doesn't match up cleanly
enough for us to use the POSIX structure.
[1]: #835 (comment)
Signed-off-by: W. Trevor King <[email protected]>
Copy file name to clipboardExpand all lines: config.md
+25-8Lines changed: 25 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,17 +130,33 @@ For Solaris, the mount entry corresponds to the 'fs' resource in the [zonecfg(1M
130
130
***`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2001's `environ`][ieee-1003.1-2001-xbd-c8.1].
131
131
***`args`** (array of strings, REQUIRED) with similar semantics to [IEEE Std 1003.1-2001 `execvp`'s *argv*][ieee-1003.1-2001-xsh-exec].
132
132
This specification extends the IEEE standard in that at least one entry is REQUIRED, and that entry is used with the same semantics as `execvp`'s *file*.
133
-
***`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for a process inside the container.
134
-
Each entry has the following structure:
135
133
136
-
***`type`** (string, REQUIRED) - the platform resource being limited, for example on Linux as defined in the [setrlimit(2)][setrlimit.2] man page.
137
-
***`soft`** (uint64, REQUIRED) - the value of the limit enforced for the corresponding resource.
138
-
***`hard`** (uint64, REQUIRED) - the ceiling for the soft limit that could be set by an unprivileged process. Only a privileged process (e.g. under Linux: one with the CAP_SYS_RESOURCE capability) can raise a hard limit.
134
+
### <aname="configLinuxAndSolarisProcess" />Linux and Solaris Process
139
135
140
-
If `rlimits` contains duplicated entries with same `type`, the runtime MUST error out.
136
+
For POSIX-based systems (Linux and Solaris), the `process` object supports the following process-specific properties:
141
137
138
+
***`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for the process.
139
+
Each entry has the following structure:
142
140
143
-
For Linux-based systems the process structure supports the following process-specific fields.
141
+
***`type`** (string, REQUIRED) the platform resource being limited.
142
+
* Linux: valid values are defined in the [`getrlimit(2)`][setrlimit.2] man page, such as `RLIMIT_MSGQUEUE`.
143
+
* Solaris: valid values are defined in the [`getrlimit(3)`][getrlimit.3] man page, such as `RLIMIT_CORE`.
144
+
145
+
The runtime MUST [generate an error](runtime.md#errors) for any values which cannot be mapped to a relevant kernel interface
146
+
For each entry in `rlimits`, a [`getrlimit(3)`][getrlimit.3] on `type` MUST succeed.
147
+
For the following properties, `rlim` refers to the status returned by the `getrlimit(3)` call.
148
+
149
+
***`soft`** (uint64, REQUIRED) the value of the limit enforced for the corresponding resource.
150
+
`rlim.rlim_cur` MUST match the configured value.
151
+
***`hard`** (uint64, REQUIRED) the ceiling for the soft limit that could be set by an unprivileged process.
152
+
`rlim.rlim_max` MUST match the configured value.
153
+
Only a privileged process (e.g. one with the `CAP_SYS_RESOURCE` capability) can raise a hard limit.
154
+
155
+
If `rlimits` contains duplicated entries with same `type`, the runtime MUST [generate an error](runtime.md#errors).
156
+
157
+
### <aname="configLinuxProcess" />Linux Process
158
+
159
+
For Linux-based systems, the `process` object supports the following process-specific properties.
144
160
145
161
***`apparmorProfile`** (string, OPTIONAL) specifies the name of the AppArmor profile to be applied to processes in the container.
146
162
For more information about AppArmor, see [AppArmor documentation][apparmor].
@@ -846,7 +862,8 @@ Here is a full example `config.json` for reference.
0 commit comments