From 1d2e1eece5ccb62c731e4d84d451a6b544c3389a Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 27 Nov 2018 21:18:44 +0100 Subject: rootless: propagate XDG_RUNTIME_DIR to the OCI runtime Signed-off-by: Giuseppe Scrivano --- libpod/oci.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libpod/oci.go b/libpod/oci.go index 6ca3ef2e6..3222f9403 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -696,8 +696,12 @@ func (r *OCIRuntime) stopContainer(ctr *Container, timeout uint) error { // deleteContainer deletes a container from the OCI runtime func (r *OCIRuntime) deleteContainer(ctr *Container) error { - _, err := utils.ExecCmd(r.path, "delete", "--force", ctr.ID()) - return err + runtimeDir, err := util.GetRootlessRuntimeDir() + if err != nil { + return err + } + env := []string{fmt.Sprintf("XDG_RUNTIME_DIR=%s", runtimeDir)} + return utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, env, r.path, "delete", "--force", ctr.ID()) } // pauseContainer pauses the given container -- cgit v1.2.3-54-g00ecf