diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-09 06:07:32 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-09 06:07:32 -0800 |
commit | e8e16fcc789df6a705fbbf5c5597f16a4255d690 (patch) | |
tree | 1869839dbc1fabbed7ca867d9828a2130365ea6b | |
parent | ace93e6a484ba5b864e1afeee131e5a576db9f77 (diff) | |
parent | c7926aa7cae3ec950fba290af662e693313854e0 (diff) | |
download | podman-e8e16fcc789df6a705fbbf5c5597f16a4255d690.tar.gz podman-e8e16fcc789df6a705fbbf5c5597f16a4255d690.tar.bz2 podman-e8e16fcc789df6a705fbbf5c5597f16a4255d690.zip |
Merge pull request #1726 from giuseppe/default-to-fuse-overlayfs
rootless: default to fuse-overlayfs when available
-rw-r--r-- | docs/podman.1.md | 2 | ||||
-rw-r--r-- | pkg/util/utils.go | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/docs/podman.1.md b/docs/podman.1.md index 085af97ff..c66a9cf05 100644 --- a/docs/podman.1.md +++ b/docs/podman.1.md @@ -56,7 +56,7 @@ Path to the OCI compatible binary used to run containers **--storage-driver, -s**=**value** -Storage driver. The default storage driver for UID 0 is configured in /etc/containers/storage.conf (`$HOME/.config/containers/storage.conf` in rootless mode), and is *vfs* for other users. The `STORAGE_DRIVER` environment variable overrides the default. The --storage-driver specified driver overrides all. +Storage driver. The default storage driver for UID 0 is configured in /etc/containers/storage.conf (`$HOME/.config/containers/storage.conf` in rootless mode), and is *vfs* for non-root users when *fuse-overlayfs* is not available. The `STORAGE_DRIVER` environment variable overrides the default. The --storage-driver specified driver overrides all. Overriding this option will cause the *storage-opt* settings in /etc/containers/storage.conf to be ignored. The user must specify additional options via the `--storage-opt` flag. 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 } |