Skip to content

Commit 26711d8

Browse files
committed
config: Make default Linux filesystems an example
The MUST default-filesystem wording altered in 279c3c0 (linux: relax filesystem requirements for container, 2017-01-23, #666) had read (to me, anyway) as: The runtime MUST supply these even if the config doesn't call for them in mounts. with 279c3c0 weaking it to: The runtime SHOULD supply these even if the config doesn't call for them in mounts. But that's not very useful (callers that *need* a given mount will still have to configure it explicitly). However, one interpretation of the 279c3c0 wording seems to be something like [1]: Config authors probably want to include mounts entries for these. That's fine, and this commit tries to make that interpretation more obvious by shifting the config recommendation over to the Linux 'mounts' example. [1]: #666 (comment) Signed-off-by: W. Trevor King <[email protected]>
1 parent 7278567 commit 26711d8

File tree

2 files changed

+35
-20
lines changed

2 files changed

+35
-20
lines changed

config-linux.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,6 @@
33
This document describes the schema for the [Linux-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md).
44
The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec.
55

6-
## Default Filesystems
7-
8-
The Linux ABI includes both syscalls and several special file paths.
9-
Applications expecting a Linux environment will very likely expect these file paths to be setup correctly.
10-
11-
The following filesystems SHOULD be made available in each container's filesystem:
12-
13-
| Path | Type |
14-
| -------- | ------ |
15-
| /proc | [procfs](https://www.kernel.org/doc/Documentation/filesystems/proc.txt) |
16-
| /sys | [sysfs](https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt) |
17-
| /dev/pts | [devpts](https://www.kernel.org/doc/Documentation/filesystems/devpts.txt) |
18-
| /dev/shm | [tmpfs](https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt) |
19-
206
## Namespaces
217

228
A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource.

config.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,48 @@ For Solaris, the mounts corresponds to fs resource in zonecfg(8).
6363

6464
### Example (Linux)
6565

66+
## Common Linux Filesystems
67+
68+
The Linux ABI includes both syscalls and several special file paths.
69+
Applications expecting a Linux environment will very likely expect these file paths to be setup correctly.
70+
Configuration authors interested in providing common filesystems can consider entries like:
71+
6672
```json
6773
"mounts": [
6874
{
69-
"destination": "/tmp",
75+
"destination": "/proc",
76+
"type": "proc",
77+
"source": "proc"
78+
},
79+
{
80+
"destination": "/dev",
7081
"type": "tmpfs",
7182
"source": "tmpfs",
72-
"options": ["nosuid","strictatime","mode=755","size=65536k"]
83+
"options": ["nosuid", "strictatime", "mode=755", "size=65536k"]
84+
},
85+
{
86+
"destination": "/dev/pts",
87+
"type": "devpts",
88+
"source": "devpts",
89+
"options": ["nosuid", "noexec", "newinstance", "ptmxmode=0666", "mode=0620", "gid=5"]
90+
},
91+
{
92+
"destination": "/dev/shm",
93+
"type": "tmpfs",
94+
"source": "shm",
95+
"options": ["nosuid", "noexec", "nodev", "mode=1777", "size=65536k"]
96+
},
97+
{
98+
"destination": "/dev/mqueue",
99+
"type": "mqueue",
100+
"source": "mqueue",
101+
"options": ["nosuid", "noexec", "nodev"]
73102
},
74103
{
75-
"destination": "/data",
76-
"type": "bind",
77-
"source": "/volumes/testing",
78-
"options": ["rbind","rw"]
104+
"destination": "/sys",
105+
"type": "sysfs",
106+
"source": "sysfs",
107+
"options": ["nosuid", "noexec", "nodev", "ro"]
79108
}
80109
]
81110
```

0 commit comments

Comments
 (0)