Add opt for default unix device permissions

These opts either inherit the parent cgroup device.list or append the
default unix devices like /dev/null /dev/random so that the container
has access.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-08-15 11:34:45 -04:00
parent a69a0b0192
commit b67ea850af
2 changed files with 105 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
if context.IsSet("config") {
opts = append(opts, oci.WithSpecFromFile(context.String("config")))
} else {
opts = append(opts, oci.WithDefaultSpec())
opts = append(opts, oci.WithDefaultSpec(), oci.WithDefaultUnixDevices)
}
opts = append(opts, oci.WithEnv(context.StringSlice("env")))