Merge pull request #21223 from cpuguy83/add_nocp_to_vols
Add explicit flags for volume cp/no-cp Upstream-commit: de9ff4bdc0e17a0fd455790972d83133f424ef9d Component: engine
This commit is contained in:
@@ -63,8 +63,7 @@ func (daemon *Daemon) createContainerPlatformSpecificSettings(container *contain
|
||||
// this is only called when the container is created.
|
||||
func (daemon *Daemon) populateVolumes(c *container.Container) error {
|
||||
for _, mnt := range c.MountPoints {
|
||||
// skip binds and volumes referenced by other containers (ie, volumes-from)
|
||||
if mnt.Driver == "" || mnt.Volume == nil || len(daemon.volumes.Refs(mnt.Volume)) > 1 {
|
||||
if !mnt.CopyData || mnt.Volume == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ func (daemon *Daemon) registerMountPoints(container *container.Container, hostCo
|
||||
bind = setBindModeIfNull(bind)
|
||||
}
|
||||
}
|
||||
|
||||
if label.RelabelNeeded(bind.Mode) {
|
||||
if err := label.Relabel(bind.Source, container.MountLabel, label.IsShared(bind.Mode)); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user