add the :Z option to all mounted volumes so that discourse works when selinux is...
authorDaniel Brooks <db48x@db48x.net>
Wed, 9 Aug 2017 00:39:10 +0000 (17:39 -0700)
committerDaniel Brooks <db48x@db48x.net>
Wed, 9 Aug 2017 00:39:10 +0000 (17:39 -0700)
launcher

index 0a90baa27d643a7e5715f06288b54a1aff020daf..687557b81c7aedc64ebbd7869a66f8fceeca4d82 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -252,8 +252,12 @@ RUBY
 
 
 set_volumes() {
+  local volopts=
+  if selinuxenabled; then
+      volopts=":Z"
+  fi
   volumes=`cat $config_file | $docker_path run $user_args --rm -i -a stdout -a stdin $image ruby -e \
-        "require 'yaml'; puts YAML.load(STDIN.readlines.join)['volumes'].map{|v| '-v ' << v['volume']['host'] << ':' << v['volume']['guest'] << ' '}.join"`
+        "require 'yaml'; puts YAML.load(STDIN.readlines.join)['volumes'].map{|v| '-v ' << v['volume']['host'] << ':' << v['volume']['guest'] << '${volopts} '}.join"`
 }
 
 set_links() {