fix: handle user UID/GID
This commit is contained in:
parent
141b1e33f2
commit
d8354512e3
1 changed files with 3 additions and 3 deletions
|
@ -9,12 +9,12 @@ echo "Arguments: $ARGS"
|
|||
EXT_UID=${EXT_UID:-999}
|
||||
EXT_GID=${EXT_GID:-999}
|
||||
|
||||
if ! grep "^[^:]*:[^:]*:$EXT_UID:" /etc/group ; then
|
||||
if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/group ; then
|
||||
groupadd -g "$EXT_GID" appuser
|
||||
fi
|
||||
|
||||
if ! grep "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then
|
||||
if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then
|
||||
useradd -r -u "$EXT_UID" -g appuser appuser
|
||||
fi
|
||||
|
||||
exec gosu appuser make "$@"
|
||||
exec gosu "$EXT_UID:$EXT_GID" make "$@"
|
||||
|
|
Loading…
Reference in a new issue