From de7144170027a4fb720b9e4668d7c248067b8166 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 1 Jun 2018 13:14:58 +0200 Subject: oci: do not use hooks in rootless mode Signed-off-by: Giuseppe Scrivano Closes: #871 Approved by: mheon --- libpod/container_internal.go | 6 ++++-- 1 file 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 { -- cgit v1.2.3-54-g00ecf