summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-06-01 13:14:58 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-15 14:53:18 +0000
commitde7144170027a4fb720b9e4668d7c248067b8166 (patch)
tree9fa3345de7e577d6ec27a85d0400f75d0f756a14 /libpod/container_internal.go
parent399c3a5e4bba2cbdab70af712b3ed75b48f4a761 (diff)
downloadpodman-de7144170027a4fb720b9e4668d7c248067b8166.tar.gz
podman-de7144170027a4fb720b9e4668d7c248067b8166.tar.bz2
podman-de7144170027a4fb720b9e4668d7c248067b8166.zip
oci: do not use hooks in rootless mode
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #871 Approved by: mheon
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go6
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 {