diff options
Diffstat (limited to 'scripts/docker-entrypoint.sh')
-rwxr-xr-x | scripts/docker-entrypoint.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh new file mode 100755 index 00000000..7520a8d9 --- /dev/null +++ b/scripts/docker-entrypoint.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +# Use GOSU_USER if its specified, else wirking dir user +if [ -n "$GOSU_USER" ]; then + ID=$GOSU_USER +else + ID=$(stat -c "%u:%g" .) +fi + +# Don't use GOSU if we are root +if [ ! "$ID" = "0:0" ]; then + exec gosu $ID "$@" +else + exec "$@" +fi |