summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-09-15 10:41:52 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-09-15 10:43:51 -0400
commit3e77f960f65687dcb1d571ebe70278028c6de441 (patch)
treece531988c837f88aee6e4548bf5a59662665a3c1 /cmd/podman
parent81f41ca0d2a0acd9896bb60b1096baa236725dec (diff)
downloadpodman-3e77f960f65687dcb1d571ebe70278028c6de441.tar.gz
podman-3e77f960f65687dcb1d571ebe70278028c6de441.tar.bz2
podman-3e77f960f65687dcb1d571ebe70278028c6de441.zip
Set default storage from containers.conf for temporary images
Fixes: https://github.com/containers/podman/issues/11107 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/root.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index c798e6634..02e6dcd27 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -174,7 +174,11 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
}
// Hard code TMPDIR functions to use /var/tmp, if user did not override
if _, ok := os.LookupEnv("TMPDIR"); !ok {
- os.Setenv("TMPDIR", "/var/tmp")
+ if tmpdir, err := cfg.ImageCopyTmpDir(); err != nil {
+ logrus.Warnf("failed to retrieve default tmp dir: %s", err.Error())
+ } else {
+ os.Setenv("TMPDIR", tmpdir)
+ }
}
context := cmd.Root().LocalFlags().Lookup("context")