summaryrefslogtreecommitdiff
path: root/cmd/podman/root.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-12-15 06:35:41 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-12-15 06:35:43 -0500
commitd5e05a4b92955e479b4d2bf29f8c2cfeae517861 (patch)
tree173fcd1ccb7fc818e2c6500394cf37b865f732d1 /cmd/podman/root.go
parent999d40d2c76992cfd2d8c0827b7b0d00c4a2a661 (diff)
downloadpodman-d5e05a4b92955e479b4d2bf29f8c2cfeae517861.tar.gz
podman-d5e05a4b92955e479b4d2bf29f8c2cfeae517861.tar.bz2
podman-d5e05a4b92955e479b4d2bf29f8c2cfeae517861.zip
Allow users to specify TMPDIR in containers.conf
Currently we hard code TMPDIR environment variable to /var/tmp if it is not set in the Environment. This causes TMPDIR environment variable to be ignored if set in containers.conf. This change now uses the host environment TMPDIR, followed by containers.conf and then hard codes TMPDIR, if it was not set. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/root.go')
-rw-r--r--cmd/podman/root.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 0830a62a5..1f613a4c5 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -178,6 +178,10 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
return err
}
}
+ // 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 !registry.IsRemote() {
if cmd.Flag("cpu-profile").Changed {