瀏覽代碼

Do not relabel if user did not request it for non local volumes

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Dan Walsh 9 年之前
父節點
當前提交
843a119d49
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      daemon/volumes.go

+ 3 - 1
daemon/volumes.go

@@ -128,7 +128,9 @@ func (daemon *Daemon) registerMountPoints(container *container.Container, hostCo
 			// bind.Name is an already existing volume, we need to use that here
 			// bind.Name is an already existing volume, we need to use that here
 			bind.Driver = v.DriverName()
 			bind.Driver = v.DriverName()
 			bind.Named = true
 			bind.Named = true
-			bind = setBindModeIfNull(bind)
+			if bind.Driver == "local" {
+				bind = setBindModeIfNull(bind)
+			}
 		}
 		}
 		if label.RelabelNeeded(bind.Mode) {
 		if label.RelabelNeeded(bind.Mode) {
 			if err := label.Relabel(bind.Source, container.MountLabel, label.IsShared(bind.Mode)); err != nil {
 			if err := label.Relabel(bind.Source, container.MountLabel, label.IsShared(bind.Mode)); err != nil {