aboutsummaryrefslogtreecommitdiff
path: root/pkg/util
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-10-30 12:34:06 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2018-11-08 10:58:49 +0100
commitc7926aa7cae3ec950fba290af662e693313854e0 (patch)
tree52f7341b074b9323685b3c55340c3c869df7d5f1 /pkg/util
parent672f572f507400a87c63b34fad137f321ded040d (diff)
downloadpodman-c7926aa7cae3ec950fba290af662e693313854e0.tar.gz
podman-c7926aa7cae3ec950fba290af662e693313854e0.tar.bz2
podman-c7926aa7cae3ec950fba290af662e693313854e0.zip
rootless: default to fuse-overlayfs when available
If fuse-overlayfs is present, rootless containers default to use it. This can still be overriden either via the command line with --storage-driver or in the ~/.config/containers/storage.conf configuration file. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/util')
-rw-r--r--pkg/util/utils.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index 69f49e72a..3b43489b2 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -3,6 +3,7 @@ package util
import (
"fmt"
"os"
+ "os/exec"
"path/filepath"
"strconv"
"strings"
@@ -273,7 +274,12 @@ func GetRootlessStorageOpts() (storage.StoreOptions, error) {
dataDir = filepath.Join(resolvedHome, ".local", "share")
}
opts.GraphRoot = filepath.Join(dataDir, "containers", "storage")
- opts.GraphDriverName = "vfs"
+ if path, err := exec.LookPath("fuse-overlayfs"); err == nil {
+ opts.GraphDriverName = "overlay"
+ opts.GraphDriverOptions = []string{fmt.Sprintf("overlay.mount_program=%s", path)}
+ } else {
+ opts.GraphDriverName = "vfs"
+ }
return opts, nil
}