From 6b76ab7e838a92f9117e20f87ad1ad8e1b177963 Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Thu, 26 May 2016 11:11:28 -0400 Subject: [PATCH] We need to relabel newly created container volumes This will add a label to any volume that is shared into a container. Signed-off-by: Dan Walsh Upstream-commit: 5a277c8a4a9107f18211aabd6e332dbafb1a8469 Component: engine --- components/engine/container/container_unix.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/engine/container/container_unix.go b/components/engine/container/container_unix.go index 667eab9ca2..63f2ff9a65 100644 --- a/components/engine/container/container_unix.go +++ b/components/engine/container/container_unix.go @@ -199,6 +199,9 @@ func (container *Container) CopyImagePathContent(v volume.Volume, destination st logrus.Warnf("error while unmounting volume %s: %v", v.Name(), err) } }() + if err := label.Relabel(path, container.MountLabel, true); err != nil && err != syscall.ENOTSUP { + return err + } return copyExistingContents(rootfs, path) }