mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
new "image" mount type
Add a new "image" mount type to `--mount`. The source of the mount is the name or ID of an image. The destination is the path inside the container. Image mounts further support an optional `rw,readwrite` parameter which if set to "true" will yield the mount writable inside the container. Note that no changes are propagated to the image mount on the host (which in any case is read only). Mounts are overlay mounts. To support read-only overlay mounts, vendor a non-release version of Buildah. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
12
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
12
vendor/github.com/containers/buildah/pkg/parse/parse.go
generated
vendored
@ -335,7 +335,7 @@ func GetBindMount(args []string) (specs.Mount, error) {
|
||||
setDest := false
|
||||
|
||||
for _, val := range args {
|
||||
kv := strings.Split(val, "=")
|
||||
kv := strings.SplitN(val, "=", 2)
|
||||
switch kv[0] {
|
||||
case "bind-nonrecursive":
|
||||
newMount.Options = append(newMount.Options, "bind")
|
||||
@ -407,7 +407,7 @@ func GetTmpfsMount(args []string) (specs.Mount, error) {
|
||||
setDest := false
|
||||
|
||||
for _, val := range args {
|
||||
kv := strings.Split(val, "=")
|
||||
kv := strings.SplitN(val, "=", 2)
|
||||
switch kv[0] {
|
||||
case "ro", "nosuid", "nodev", "noexec":
|
||||
newMount.Options = append(newMount.Options, kv[0])
|
||||
@ -789,9 +789,7 @@ func IDMappingOptions(c *cobra.Command, isolation buildah.Isolation) (usernsOpti
|
||||
case "host":
|
||||
usernsOption.Host = true
|
||||
default:
|
||||
if strings.HasPrefix(how, "ns:") {
|
||||
how = how[3:]
|
||||
}
|
||||
how = strings.TrimPrefix(how, "ns:")
|
||||
if _, err := os.Stat(how); err != nil {
|
||||
return nil, nil, errors.Wrapf(err, "error checking for %s namespace at %q", string(specs.UserNamespace), how)
|
||||
}
|
||||
@ -890,9 +888,7 @@ func NamespaceOptions(c *cobra.Command) (namespaceOptions buildah.NamespaceOptio
|
||||
break
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(how, "ns:") {
|
||||
how = how[3:]
|
||||
}
|
||||
how = strings.TrimPrefix(how, "ns:")
|
||||
if _, err := os.Stat(how); err != nil {
|
||||
return nil, buildah.NetworkDefault, errors.Wrapf(err, "error checking for %s namespace at %q", what, how)
|
||||
}
|
||||
|
Reference in New Issue
Block a user