Add --device flag to ctr
Closes #3066 Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -126,6 +126,10 @@ var (
|
||||
Name: "memory-limit",
|
||||
Usage: "memory limit (in bytes) for the container",
|
||||
},
|
||||
cli.StringSliceFlag{
|
||||
Name: "device",
|
||||
Usage: "add a device to a container",
|
||||
},
|
||||
}
|
||||
// ImageDecryptionFlags are cli flags needed when decrypting an image
|
||||
ImageDecryptionFlags = []cli.Flag{
|
||||
|
@@ -155,6 +155,9 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
|
||||
if limit != 0 {
|
||||
opts = append(opts, oci.WithMemoryLimit(limit))
|
||||
}
|
||||
for _, dev := range context.StringSlice("device") {
|
||||
opts = append(opts, oci.WithLinuxDevice(dev, "rwm"))
|
||||
}
|
||||
}
|
||||
|
||||
cOpts = append(cOpts, containerd.WithRuntime(context.String("runtime"), nil))
|
||||
|
Reference in New Issue
Block a user