ctr: Add sandbox flag to ctr run
Add a flag to be able to run a container in a given sandbox. Signed-off-by: Danny Canter <danny@dcantah.dev>
This commit is contained in:
@@ -102,6 +102,10 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
|
||||
spec containerd.NewContainerOpts
|
||||
)
|
||||
|
||||
if sandbox := context.String("sandbox"); sandbox != "" {
|
||||
cOpts = append(cOpts, containerd.WithSandbox(sandbox))
|
||||
}
|
||||
|
||||
if config {
|
||||
cOpts = append(cOpts, containerd.WithContainerLabels(commands.LabelArgs(context.StringSlice("label"))))
|
||||
opts = append(opts, oci.WithSpecFromFile(context.String("config")))
|
||||
|
||||
Reference in New Issue
Block a user