diff options
-rw-r--r-- | cmd/podman/spec.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/podman/spec.go b/cmd/podman/spec.go index e807ab642..7cd21aeba 100644 --- a/cmd/podman/spec.go +++ b/cmd/podman/spec.go @@ -653,7 +653,16 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er } if len(c.Volumes) != 0 { - options = append(options, libpod.WithUserVolumes(c.Volumes)) + // Volumes consist of multiple, comma-delineated fields + // The image spec only includes one part of that, so drop the + // others, if they are included + volumes := make([]string, 0, len(c.Volumes)) + for _, vol := range c.Volumes { + splitVol := strings.Split(vol, ":") + volumes = append(volumes, splitVol[0]) + } + + options = append(options, libpod.WithUserVolumes(volumes)) } if len(c.Command) != 0 { |