diff options
author | umohnani8 <umohnani@redhat.com> | 2018-02-16 10:38:12 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-02-22 15:14:00 +0000 |
commit | 3d395767d8c3e467e784e3836c7175f6d11931a7 (patch) | |
tree | a64044df96164ad10873ad5a642e576b99b33bdd /libpod/container_api.go | |
parent | 7a7a6c2d79ebd831acf0321643903136dca7c2cb (diff) | |
download | podman-3d395767d8c3e467e784e3836c7175f6d11931a7.tar.gz podman-3d395767d8c3e467e784e3836c7175f6d11931a7.tar.bz2 podman-3d395767d8c3e467e784e3836c7175f6d11931a7.zip |
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 <umohnani@redhat.com>
Closes: #377
Approved by: rhatdan
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index 6fdc45589..149197470 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -144,6 +144,13 @@ func (c *Container) Init() (err error) { } g.AddMount(hostnameMnt) + // Bind builtin image volumes + if c.config.ImageVolumes { + if err = c.addImageVolumes(&g); err != nil { + return errors.Wrapf(err, "error mounting image volumes") + } + } + if c.config.User != "" { if !c.state.Mounted { return errors.Wrapf(ErrCtrStateInvalid, "container %s must be mounted in order to translate User field", c.ID()) |