-
Notifications
You must be signed in to change notification settings - Fork 160
Fixes to ocitools generate to make it work with runc again #24
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 |
|---|---|---|
|
|
@@ -599,6 +599,8 @@ func setupNamespaces(spec *specs.Spec, context *cli.Context) { | |
| spec.Linux.Namespaces = linuxNs | ||
| } | ||
|
|
||
| func sPtr(s string) *string { return &s } | ||
|
|
||
| func getDefaultTemplate() specs.Spec { | ||
| spec := specs.Spec{ | ||
| Version: specs.Version, | ||
|
|
@@ -646,8 +648,53 @@ func getDefaultTemplate() specs.Spec { | |
| }, | ||
| }, | ||
| Hostname: "shell", | ||
| Mounts: []specs.Mount{}, | ||
| Mounts: []specs.Mount{ | ||
| { | ||
| Destination: "/proc", | ||
| Type: "proc", | ||
| Source: "proc", | ||
| Options: nil, | ||
| }, | ||
| { | ||
| Destination: "/dev", | ||
| Type: "tmpfs", | ||
| Source: "tmpfs", | ||
| Options: []string{"nosuid", "strictatime", "mode=755", "size=65536k"}, | ||
| }, | ||
| { | ||
| Destination: "/dev/pts", | ||
|
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. This one is causing trouble in my ccon-oci tests. The previous mount just put a tmpfs at /dev, so there is no directory at I don't see any language about “the runtime MUST create missing destinations” in the spec, and I don't see a way to support this default template without doing that. Are there suggestions for how other runtimes should handle entries like this until runC sorts out its required filesystems support?
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.
The current spec still doesn't talk about this explicitly, but the intended approach is to have the runtime attempt to create the destination file/directory on its own. |
||
| Type: "devpts", | ||
| Source: "devpts", | ||
| Options: []string{"nosuid", "noexec", "newinstance", "ptmxmode=0666", "mode=0620", "gid=5"}, | ||
|
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. The
So if the caller maps themselves to 0, then all other GIDs (including 5) will be unmapped. Are we not compliance testing unprivileged processes until runC sorts out its required filesystems support? If we are, how should I handle this mount entry? |
||
| }, | ||
| { | ||
| Destination: "/dev/shm", | ||
| Type: "tmpfs", | ||
| Source: "shm", | ||
| Options: []string{"nosuid", "noexec", "nodev", "mode=1777", "size=65536k"}, | ||
| }, | ||
| { | ||
| Destination: "/dev/mqueue", | ||
| Type: "mqueue", | ||
| Source: "mqueue", | ||
| Options: []string{"nosuid", "noexec", "nodev"}, | ||
| }, | ||
| { | ||
| Destination: "/sys", | ||
| Type: "sysfs", | ||
| Source: "sysfs", | ||
| Options: []string{"nosuid", "noexec", "nodev", "ro"}, | ||
| }, | ||
| }, | ||
| Linux: specs.Linux{ | ||
| Resources: &specs.Resources{ | ||
| Devices: []specs.DeviceCgroup{ | ||
| { | ||
| Allow: false, | ||
| Access: sPtr("rwm"), | ||
| }, | ||
| }, | ||
| }, | ||
| Namespaces: []specs.Namespace{ | ||
| { | ||
| Type: "pid", | ||
|
|
||
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.
It looks like this is rolling back 080ee00 (drop-runtime-supplied-devices-and-mounts, #2). Did we miss something there?
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.
@wking runc supports default devices but not mounts yet.
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.
On Wed, Mar 23, 2016 at 03:26:02PM -0700, Mrunal Patel wrote:
Ah, got it. Maybe add a note to that effect in the commit message?
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.
@wking Updated the commit message.
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.
On Wed, Mar 23, 2016 at 04:04:14PM -0700, Mrunal Patel wrote:
Thanks. 85943a0 looks good to me.