diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-27 21:18:44 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-30 22:37:09 +0100 |
commit | 1d2e1eece5ccb62c731e4d84d451a6b544c3389a (patch) | |
tree | 49131f99603330f405579d1d653ea9cd2ff473c3 /libpod | |
parent | d837dd3e2a97d6562f4b06b2f6644a38092f5ca7 (diff) | |
download | podman-1d2e1eece5ccb62c731e4d84d451a6b544c3389a.tar.gz podman-1d2e1eece5ccb62c731e4d84d451a6b544c3389a.tar.bz2 podman-1d2e1eece5ccb62c731e4d84d451a6b544c3389a.zip |
rootless: propagate XDG_RUNTIME_DIR to the OCI runtime
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/oci.go | 8 |
1 files 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 |