Merge pull request #4847 from cpuguy83/devices_by_dir
Support adding devices by dir
This commit is contained in:
@@ -153,7 +153,7 @@ var (
|
||||
},
|
||||
cli.StringSliceFlag{
|
||||
Name: "device",
|
||||
Usage: "add a device to a container",
|
||||
Usage: "file path to a device to add to the container; or a path to a directory tree of devices to add to the container",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "seccomp",
|
||||
|
||||
@@ -264,7 +264,7 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
|
||||
opts = append(opts, oci.WithMemoryLimit(limit))
|
||||
}
|
||||
for _, dev := range context.StringSlice("device") {
|
||||
opts = append(opts, oci.WithLinuxDevice(dev, "rwm"))
|
||||
opts = append(opts, oci.WithDevices(dev, "", "rwm"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user