summaryrefslogtreecommitdiff
path: root/scripts/docker-entrypoint.sh
blob: 7520a8d92dd70c2904ad80cf511f801078cf5e18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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