diff --git a/libpod/define/mount_freebsd.go b/libpod/define/mount_freebsd.go index e080c9ec6c..3150ffbe7a 100644 --- a/libpod/define/mount_freebsd.go +++ b/libpod/define/mount_freebsd.go @@ -6,3 +6,8 @@ const ( // TypeBind is the type for mounting host dir TypeBind = "nullfs" ) + +var ( + // Mount potions for bind + BindOptions = []string{} +) diff --git a/libpod/define/mount_linux.go b/libpod/define/mount_linux.go index 5ef8489052..126e0d6c77 100644 --- a/libpod/define/mount_linux.go +++ b/libpod/define/mount_linux.go @@ -6,3 +6,8 @@ const ( // TypeBind is the type for mounting host dir TypeBind = "bind" ) + +var ( + // Mount potions for bind + BindOptions = []string{"bind"} +) diff --git a/pkg/specgen/generate/storage.go b/pkg/specgen/generate/storage.go index ffaaa0e1fb..52d7427520 100644 --- a/pkg/specgen/generate/storage.go +++ b/pkg/specgen/generate/storage.go @@ -363,7 +363,7 @@ func addContainerInitBinary(s *specgen.SpecGenerator, path string) (spec.Mount, Destination: define.ContainerInitPath, Type: define.TypeBind, Source: path, - Options: []string{define.TypeBind, "ro"}, + Options: append(define.BindOptions, "ro"), } if path == "" {