mirror of
https://github.com/containers/podman.git
synced 2025-10-17 03:04:21 +08:00
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
This commit is contained in:
@ -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())
|
||||
|
Reference in New Issue
Block a user