Skip to content

Commit

Permalink
Set TMPDIR to /var/tmp by default
Browse files Browse the repository at this point in the history
We have had some issues with users squashing large images or pulling large
content from github, that could trigger crashes based on the size of /tmp.

Docker had an issue with this back in 2016. golang/go#14021

The discussion there was to change the default to /var/tmp.

This change will only effect systems that do not set the TMPDIR environment variable.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Sep 4, 2019
1 parent e930951 commit ee79069
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/buildah/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ func main() {
if buildah.InitReexec() {
return
}
// 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 err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
os.Exit(1)
Expand Down

0 comments on commit ee79069

Please sign in to comment.