pkg/specgen: add support for 'podman run --init' on FreeBSD

This adds define.BindOptions to declare the mount options for bind-like
mounts (nullfs on FreeBSD). Note: this mirrors identical declarations in
buildah and it may be preferable to use buildah's copies throughout
podman.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson
2023-06-12 14:26:09 +01:00
parent 416b4eeac6
commit 865d77e942
3 changed files with 11 additions and 1 deletions

View File

@ -6,3 +6,8 @@ const (
// TypeBind is the type for mounting host dir
TypeBind = "nullfs"
)
var (
// Mount potions for bind
BindOptions = []string{}
)

View File

@ -6,3 +6,8 @@ const (
// TypeBind is the type for mounting host dir
TypeBind = "bind"
)
var (
// Mount potions for bind
BindOptions = []string{"bind"}
)

View File

@ -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 == "" {