-
Notifications
You must be signed in to change notification settings - Fork 593
Replace Linux.Device with more specific config #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,20 +55,82 @@ within the container. | |
|
|
||
| ### Access to devices | ||
|
|
||
| Devices is an array specifying the list of devices from the host to make available in the container. | ||
| By providing a device name within the list the runtime should look up the same device on the host's `/dev` | ||
| and collect information about the device node so that it can be recreated for the container. The runtime | ||
| should not only create the device inside the container but ensure that the root user inside | ||
| the container has access rights for the device. | ||
| Devices is an array specifying the list of devices to be created in the container. | ||
| Next parameters can be specified: | ||
|
|
||
| * type - type of device: 'c', 'b', 'u' or 'p'. More info in `man mknod` | ||
| * path - full path to device inside container | ||
| * major, minor - major, minor numbers for device. More info in `man mknod`. | ||
| There is special value: `-1`, which means `*` for `device` | ||
| cgroup setup. | ||
| * permissions - cgroup permissions for device. A composition of 'r' | ||
| (read), 'w' (write), and 'm' (mknod). | ||
| * fileMode - file mode for device file | ||
| * uid - uid of device owner | ||
| * gid - gid of device owner | ||
|
|
||
| ```json | ||
| "devices": [ | ||
| "null", | ||
| "random", | ||
| "full", | ||
| "tty", | ||
| "zero", | ||
| "urandom" | ||
| { | ||
| "path": "/dev/random", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably specify or describe in this doc what each of the fields mean. But overall this PR looks good
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll combine description from docstrings.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there ever a reason not to include null, random, full, tty, zero and urandom? It seems like we should just say every container can expect to have those device nodes available without specifying.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, okay, thought about this just like about json example, not real config :) I'll add all from runc defaults.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @LK4D4 Yes, I will file a separate issue on this one.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "type": "c", | ||
| "major": 1, | ||
| "minor": 8, | ||
| "permissions": "rwm", | ||
| "fileMode": 0666, | ||
| "uid": 0, | ||
| "gid": 0 | ||
| }, | ||
| { | ||
| "path": "/dev/urandom", | ||
| "type": "c", | ||
| "major": 1, | ||
| "minor": 9, | ||
| "permissions": "rwm", | ||
| "fileMode": 0666, | ||
| "uid": 0, | ||
| "gid": 0 | ||
| }, | ||
| { | ||
| "path": "/dev/null", | ||
| "type": "c", | ||
| "major": 1, | ||
| "minor": 3, | ||
| "permissions": "rwm", | ||
| "fileMode": 0666, | ||
| "uid": 0, | ||
| "gid": 0 | ||
| }, | ||
| { | ||
| "path": "/dev/zero", | ||
| "type": "c", | ||
| "major": 1, | ||
| "minor": 5, | ||
| "permissions": "rwm", | ||
| "fileMode": 0666, | ||
| "uid": 0, | ||
| "gid": 0 | ||
| }, | ||
| { | ||
| "path": "/dev/tty", | ||
| "type": "c", | ||
| "major": 5, | ||
| "minor": 0, | ||
| "permissions": "rwm", | ||
| "fileMode": 0666, | ||
| "uid": 0, | ||
| "gid": 0 | ||
| }, | ||
| { | ||
| "path": "/dev/full", | ||
| "type": "c", | ||
| "major": 1, | ||
| "minor": 7, | ||
| "permissions": "rwm", | ||
| "fileMode": 0666, | ||
| "uid": 0, | ||
| "gid": 0 | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my instinct, the abbreviation of r/w/m is OK for permissions. But here, I think we should use "character", "block" and "fifo". I don't have strong reason, just feeling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is okay as more information could be looked up in the man page.