Add --privileged option to ctr run
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
062c3a00ef
commit
903191072e
@ -68,6 +68,10 @@ var ContainerFlags = []cli.Flag{
|
|||||||
Name: "net-host",
|
Name: "net-host",
|
||||||
Usage: "enable host networking for the container",
|
Usage: "enable host networking for the container",
|
||||||
},
|
},
|
||||||
|
cli.BoolFlag{
|
||||||
|
Name: "privileged",
|
||||||
|
Usage: "run privileged container",
|
||||||
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "read-only",
|
Name: "read-only",
|
||||||
Usage: "set the containers filesystem as readonly",
|
Usage: "set the containers filesystem as readonly",
|
||||||
|
@ -103,6 +103,9 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
|
|||||||
if context.Bool("tty") {
|
if context.Bool("tty") {
|
||||||
opts = append(opts, oci.WithTTY)
|
opts = append(opts, oci.WithTTY)
|
||||||
}
|
}
|
||||||
|
if context.Bool("privileged") {
|
||||||
|
opts = append(opts, oci.WithPrivileged)
|
||||||
|
}
|
||||||
if context.Bool("net-host") {
|
if context.Bool("net-host") {
|
||||||
opts = append(opts, oci.WithHostNamespace(specs.NetworkNamespace), oci.WithHostHostsFile, oci.WithHostResolvconf)
|
opts = append(opts, oci.WithHostNamespace(specs.NetworkNamespace), oci.WithHostHostsFile, oci.WithHostResolvconf)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user