diff options
author | Maxwell Bloch <maxwellbloch@live.com> | 2018-09-12 19:11:10 -0400 |
---|---|---|
committer | Maxwell Bloch <Maxwell.Bloch@AppliedIS.com> | 2018-09-12 19:29:03 -0400 |
commit | a7c05f41f1f213daff93a253412aa30d2c3769c0 (patch) | |
tree | 54ab03e1d265edff442a6a58e9900a0a8144ddb4 /script | |
parent | bd8b2dfbbced263d3043a72670fe258496cc1883 (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-x | script/run/run.sh | 5 |
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 "$@" |