Skip to content

Commit

Permalink
Add support for setting the large files tmpdir to v1.6
Browse files Browse the repository at this point in the history
This is based on 2c328f9 by Les
Aker, and e53fc16b9f470a137abf182b0561a16447bfd5b7 by Dan Walsh
(the latter from containers/buildah). They have been merge here
to allow this to compile on the older v1.6 branch of Podman.

Unfortunately this does not fix Buildah, as the Buildah patches
are too new to apply on top of this old branch.

Signed-off-by: Matthew Heon <[email protected]>
  • Loading branch information
mheon committed Sep 16, 2020
1 parent bdbe35a commit 9eb42f3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libpod/image/docker_registry_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package image

import (
"fmt"
"os"

"github.com/containers/image/v5/docker/reference"
"github.com/containers/image/v5/types"

podmanVersion "github.com/containers/libpod/version"
)

Expand Down Expand Up @@ -41,6 +41,7 @@ func (o DockerRegistryOptions) GetSystemContext(parent *types.SystemContext, add
DockerArchiveAdditionalTags: additionalDockerArchiveTags,
OSChoice: o.OSChoice,
ArchitectureChoice: o.ArchitectureChoice,
BigFilesTemporaryDir: GetTempDir(),
}
if parent != nil {
sc.SignaturePolicyPath = parent.SignaturePolicyPath
Expand All @@ -65,3 +66,11 @@ func GetSystemContext(signaturePolicyPath, authFilePath string, forceCompress bo

return sc
}

// Retrieve the temporary directory for storing large files.
func GetTempDir() string {
if tmpdir, ok := os.LookupEnv("TMPDIR"); ok {
return tmpdir
}
return "/var/tmp"
}

0 comments on commit 9eb42f3

Please sign in to comment.