diff options
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 4f5d7f0fd..0698222a1 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -1173,8 +1173,10 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) { } var err error - if c.state.ExtensionStageHooks, err = c.setupOCIHooks(ctx, &g); err != nil { - return nil, errors.Wrapf(err, "error setting up OCI Hooks") + if os.Getuid() == 0 { + if c.state.ExtensionStageHooks, err = c.setupOCIHooks(ctx, &g); err != nil { + return nil, errors.Wrapf(err, "error setting up OCI Hooks") + } } // Bind builtin image volumes if c.config.Rootfs == "" && c.config.ImageVolumes { |