From 3d395767d8c3e467e784e3836c7175f6d11931a7 Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Fri, 16 Feb 2018 10:38:12 -0500 Subject: Implement --image-volumes for create and run --image-volumes tells podman what to do with the image volumes in the image config There are 3 options: bind, tmpfs, and ignore bind puts the volume contents in /var/lib/containers/storage/container-id/volumes/vol-dir and bind mounts it into the container at /vol-dir tmpfs mounts /vol-dir as a tmps into the container ignore doesn't mount the image volumes onto the container Signed-off-by: umohnani8 Closes: #377 Approved by: rhatdan --- cmd/podman/run.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmd/podman/run.go') diff --git a/cmd/podman/run.go b/cmd/podman/run.go index f13e293bc..3d6175cef 100644 --- a/cmd/podman/run.go +++ b/cmd/podman/run.go @@ -54,6 +54,7 @@ func runCmd(c *cli.Context) error { if err != nil { return err } + useImageVolumes := createConfig.ImageVolumeType == "bind" runtimeSpec, err := createConfigToOCISpec(createConfig) if err != nil { @@ -66,7 +67,7 @@ func runCmd(c *cli.Context) error { } // Gather up the options for NewContainer which consist of With... funcs - options = append(options, libpod.WithRootFSFromImage(createConfig.ImageID, createConfig.Image, true)) + options = append(options, libpod.WithRootFSFromImage(createConfig.ImageID, createConfig.Image, useImageVolumes)) options = append(options, libpod.WithSELinuxLabels(createConfig.ProcessLabel, createConfig.MountLabel)) options = append(options, libpod.WithLabels(createConfig.Labels)) options = append(options, libpod.WithUser(createConfig.User)) -- cgit v1.2.3-54-g00ecf