Skip to content

Commit 744912b

Browse files
committed
add domainname spec entity
add the domainname entity so that container runtimes can add special handling similar to hostname. The current workaround of adding a sysctl for kernel.domainname only works with rootful execution in most cases. This will allow for rootless execution. container runtimes will be able to add special handling as they do for hostname, using setdomainname to add the entry to /proc/sys/kernel/domainname. Signed-off-by: Charlie Doern <[email protected]>
1 parent a8106e9 commit 744912b

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

config.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,18 @@ For Windows based systems the user structure has the following fields:
355355
"hostname": "mrsdalloway"
356356
```
357357

358+
## <a name="configDomainname" />Domainname
359+
360+
* **`domainname`** (string, OPTIONAL) specifies the container's domainname as seen by processes running inside the container.
361+
On Linux, for example, this will change the domainname in the [container](glossary.md#container-namespace) [UTS namespace][uts-namespace.7].
362+
Depending on your [namespace configuration](config-linux.md#namespaces), the container UTS namespace may be the [runtime](glossary.md#runtime-namespace) [UTS namespace][uts-namespace.7].
363+
364+
### Example
365+
366+
```json
367+
"domainname": "foobarbaz.test"
368+
```
369+
358370
## <a name="configPlatformSpecificConfiguration" />Platform-specific configuration
359371

360372
* **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md).

schema/config-schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"hostname": {
3636
"type": "string"
3737
},
38+
"domainname": {
39+
"type": "string"
40+
},
3841
"mounts": {
3942
"type": "array",
4043
"items": {

schema/test/config/good/spec-example.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"readonly": true
6464
},
6565
"hostname": "slartibartfast",
66+
"domainname": "foobarbaz.test",
6667
"mounts": [
6768
{
6869
"destination": "/proc",

specs-go/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ type Spec struct {
1212
Root *Root `json:"root,omitempty"`
1313
// Hostname configures the container's hostname.
1414
Hostname string `json:"hostname,omitempty"`
15+
// Domainname configures the container's domainname.
16+
Domainname string `json:"domainname,omitempty"`
1517
// Mounts configures additional mounts (on top of Root).
1618
Mounts []Mount `json:"mounts,omitempty"`
1719
// Hooks configures callbacks for container lifecycle events.

0 commit comments

Comments
 (0)