Handle userns security

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

Signed-off-by: Maxwell Bloch <maxwellbloch@live.com>
This commit is contained in:
Maxwell Bloch 2018-09-12 19:11:10 -04:00 committed by Maxwell Bloch
parent bd8b2dfbbc
commit a7c05f41f1
1 changed files with 5 additions and 0 deletions

View File

@ -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 "$@"