Skip to content

Commit

Permalink
fix systemcontext to use correct TMPDIR
Browse files Browse the repository at this point in the history
Users are complaining about read/only /var/tmp failing
even if TMPDIR=/tmp is set.

This PR Fixes: containers#10698

[NO TESTS NEEDED] No way to test this.

Signed-off-by: Daniel J Walsh <[email protected]>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <[email protected]>
  • Loading branch information
rhatdan authored and mheon committed Jun 25, 2021
1 parent 5dabff2 commit 9f4afa1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion libpod/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"
"syscall"

"github.com/containers/buildah/pkg/parse"
"github.com/containers/common/pkg/config"
"github.com/containers/common/pkg/secrets"
"github.com/containers/image/v5/manifest"
Expand Down Expand Up @@ -268,8 +269,11 @@ func WithRegistriesConf(path string) RuntimeOption {
return errors.Wrap(err, "error locating specified registries.conf")
}
if rt.imageContext == nil {
rt.imageContext = &types.SystemContext{}
rt.imageContext = &types.SystemContext{
BigFilesTemporaryDir: parse.GetTempDir(),
}
}

rt.imageContext.SystemRegistriesConfPath = path
return nil
}
Expand Down
5 changes: 4 additions & 1 deletion libpod/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"syscall"
"time"

"github.com/containers/buildah/pkg/parse"
"github.com/containers/common/libimage"
"github.com/containers/common/pkg/config"
"github.com/containers/image/v5/pkg/sysregistriesv2"
Expand Down Expand Up @@ -379,7 +380,9 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (retErr error) {

// Set up containers/image
if runtime.imageContext == nil {
runtime.imageContext = &types.SystemContext{}
runtime.imageContext = &types.SystemContext{
BigFilesTemporaryDir: parse.GetTempDir(),
}
}
runtime.imageContext.SignaturePolicyPath = runtime.config.Engine.SignaturePolicyPath

Expand Down

0 comments on commit 9f4afa1

Please sign in to comment.