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 <wking@tremily.us>
Copy file name to clipboardExpand all lines: config.md
+25-8Lines changed: 25 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -145,17 +145,33 @@ For all platform-specific configuration values, the scope defined below in the [
145
145
***`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2001's `environ`][ieee-1003.1-2001-xbd-c8.1].
146
146
***`args`** (array of strings, REQUIRED) with similar semantics to [IEEE Std 1003.1-2001 `execvp`'s *argv*][ieee-1003.1-2001-xsh-exec].
147
147
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*.
148
-
***`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for a process inside the container.
148
+
149
+
### <aname="configLinuxAndSolarisProcess" />Linux and Solaris Process
150
+
151
+
For POSIX-based systems (Linux and Solaris), the `process` object supports the following process-specific properties:
152
+
153
+
***`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for the process.
149
154
Each entry has the following structure:
150
155
151
-
***`type`** (string, REQUIRED) - the platform resource being limited, for example on Linux as defined in the [setrlimit(2)][setrlimit.2] man page.
152
-
***`soft`** (uint64, REQUIRED) - the value of the limit enforced for the corresponding resource.
153
-
***`hard`** (uint64, REQUIRED) - the ceiling for the soft limit that could be set by an unprivileged process.
154
-
Only a privileged process (e.g. under Linux: one with the CAP_SYS_RESOURCE capability) can raise a hard limit.
156
+
***`type`** (string, REQUIRED) the platform resource being limited.
157
+
* Linux: valid values are defined in the [`getrlimit(2)`][setrlimit.2] man page, such as `RLIMIT_MSGQUEUE`.
158
+
* Solaris: valid values are defined in the [`getrlimit(3)`][getrlimit.3] man page, such as `RLIMIT_CORE`.
159
+
160
+
The runtime MUST [generate an error](runtime.md#errors) for any values which cannot be mapped to a relevant kernel interface
161
+
For each entry in `rlimits`, a [`getrlimit(3)`][getrlimit.3] on `type` MUST succeed.
162
+
For the following properties, `rlim` refers to the status returned by the `getrlimit(3)` call.
163
+
164
+
***`soft`** (uint64, REQUIRED) the value of the limit enforced for the corresponding resource.
165
+
`rlim.rlim_cur` MUST match the configured value.
166
+
***`hard`** (uint64, REQUIRED) the ceiling for the soft limit that could be set by an unprivileged process.
167
+
`rlim.rlim_max` MUST match the configured value.
168
+
Only a privileged process (e.g. one with the `CAP_SYS_RESOURCE` capability) can raise a hard limit.
169
+
170
+
If `rlimits` contains duplicated entries with same `type`, the runtime MUST [generate an error](runtime.md#errors).
155
171
156
-
If `rlimits` contains duplicated entries with same `type`, the runtime MUST error out.
172
+
### <aname="configLinuxProcess" />Linux Process
157
173
158
-
For Linux-based systems the process structure supports the following process-specific fields.
174
+
For Linux-based systems, the `process` object supports the following process-specific properties.
159
175
160
176
***`apparmorProfile`** (string, OPTIONAL) specifies the name of the AppArmor profile to be applied to processes in the container.
161
177
For more information about AppArmor, see [AppArmor documentation][apparmor].
@@ -862,7 +878,8 @@ Here is a full example `config.json` for reference.
0 commit comments