Skip to content

Commit 470c90d

Browse files
committed
Drop linux.devices
Copying devices from the runtime host isn't particularly portable, and it's easy to mount any device nodes you need from the bundle itself (just like we'd mount any other files needed by the container). Signed-off-by: W. Trevor King <wking@tremily.us>
1 parent 7414f4d commit 470c90d

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

config-linux.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,13 @@ within the container.
5555

5656
### Access to devices
5757

58-
Devices is an array specifying the list of devices from the host to make available in the container.
59-
By providing a device name within the list the runtime should look up the same device on the host's `/dev`
60-
and collect information about the device node so that it can be recreated for the container. The runtime
61-
should not only create the device inside the container but ensure that the root user inside
62-
the container has access rights for the device.
58+
Devices required by the application should be supplied via the bundle filesystems and mounted via [mounts][].
59+
Bundle authors can create these files using [`mknod`][] or by copying nodes from their local host.
60+
For example:
6361

64-
```json
65-
"devices": [
66-
"null",
67-
"random",
68-
"full",
69-
"tty",
70-
"zero",
71-
"urandom"
72-
]
62+
```shell
63+
$ mknod --mode a=rw rootfs/dev/random c 1 8
64+
$ cp --archive /dev/tty rootfs/dev/tty
7365
```
7466

7567
## Linux control groups
@@ -150,3 +142,5 @@ rootfsPropagation sets the rootfs's mount propagation. Its value is either slave
150142

151143
**TODO:** security profiles
152144

145+
[mounts]: config.md#mount-configuration
146+
[mknod]: http://linux.die.net/man/1/mknod

spec_linux.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ type Linux struct {
2626
Namespaces []Namespace `json:"namespaces"`
2727
// Capabilities are Linux capabilities that are kept for the container
2828
Capabilities []string `json:"capabilities"`
29-
// Devices are a list of device nodes that are created and enabled for the container
30-
Devices []string `json:"devices"`
3129
// RootfsPropagation is the rootfs mount propagation mode for the container
3230
RootfsPropagation string `json:"rootfsPropagation"`
3331
}

0 commit comments

Comments
 (0)