volume: new options [no]copy

add two new options to the volume create command: copy and nocopy.

When nocopy is specified, the files from the container image are not
copied up to the volume.

Closes: https://github.com/containers/podman/issues/14722

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano
2022-06-25 18:59:53 +02:00
parent a4094530bc
commit aada13f244
8 changed files with 38 additions and 14 deletions

View File

@ -55,6 +55,12 @@ func (v *Volume) needsMount() bool {
if _, ok := v.config.Options["NOQUOTA"]; ok {
index++
}
if _, ok := v.config.Options["nocopy"]; ok {
index++
}
if _, ok := v.config.Options["copy"]; ok {
index++
}
// when uid or gid is set there is also the "o" option
// set so we have to ignore this one as well
if index > 0 {