summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorMaxwell Bloch <maxwellbloch@live.com>2018-09-12 19:11:10 -0400
committerMaxwell Bloch <Maxwell.Bloch@AppliedIS.com>2018-09-12 19:29:03 -0400
commita7c05f41f1f213daff93a253412aa30d2c3769c0 (patch)
tree54ab03e1d265edff442a6a58e9900a0a8144ddb4 /script
parentbd8b2dfbbced263d3043a72670fe258496cc1883 (diff)
Handle userns security
- Adds `--userns=host` when `userns-remap` is set Signed-off-by: Maxwell Bloch <maxwellbloch@live.com>
Diffstat (limited to 'script')
-rwxr-xr-xscript/run/run.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/script/run/run.sh b/script/run/run.sh
index fe253875..6b004606 100755
--- a/script/run/run.sh
+++ b/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 "$@"