From 5761b4a8bd93437f4ed76cb07a783d73533e0be9 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Fri, 22 Apr 2016 15:06:47 +0200 Subject: [PATCH] Fix SELinux settings for mounted volumes --- build/common.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/common.sh b/build/common.sh index c83942e1e65..2de4158d40a 100755 --- a/build/common.sh +++ b/build/common.sh @@ -319,7 +319,7 @@ function kube::build::prepare_output() { # On RHEL/Fedora SELinux is enabled by default and currently breaks docker # volume mounts. We can work around this by explicitly adding a security # context to the _output directory. - # Details: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Resource_Management_and_Linux_Containers_Guide/sec-Sharing_Data_Across_Containers.html#sec-Mounting_a_Host_Directory_to_a_Container + # Details: http://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/ if which selinuxenabled &>/dev/null && \ selinuxenabled && \ which chcon >/dev/null ; then @@ -330,6 +330,12 @@ function kube::build::prepare_output() { echo " Continuing, but this build may fail later if SELinux prevents access." fi fi + number=${#DOCKER_MOUNT_ARGS[@]} + for (( i=0; i