Ver Fonte

Handle userns security

- Adds `--userns=host` when `userns-remap` is set

Signed-off-by: Maxwell Bloch <[email protected]>
Maxwell Bloch há 7 anos atrás
pai
commit
a7c05f41f1
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      script/run/run.sh

+ 5 - 0
script/run/run.sh

@@ -55,4 +55,9 @@ else
     DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS -i"
 fi
 
+# Handle userns security
+if [ ! -z "$(docker info 2>/dev/null | grep userns)" ]; then
+    DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS --userns=host"
+fi
+
 exec docker run --rm $DOCKER_RUN_OPTIONS $DOCKER_ADDR $COMPOSE_OPTIONS $VOLUMES -w "$(pwd)" $IMAGE "$@"