Skip to content

Commit 4d56416

Browse files
authored
Merge pull request #9 from JohanEngelen/patch-1
Entrypoint.sh: use common way to execute argument given
2 parents c9f888e + a5d5290 commit 4d56416

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

entrypoint.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
USER_NAME=${USER:-root}
44
USER_ID=${LOCAL_USER_ID:-0}
55
GROUP_ID=${LOCAL_GROUP_ID:-0}
6-
CMD=${*:-/bin/bash}
76

87
if [ "${USER_ID}" -ne "0" ]; then
98
groupadd -g ${GROUP_ID} ${USER_NAME} &> /dev/null
109
useradd --shell /bin/bash -M -u ${USER_ID} -g ${GROUP_ID} -o -c "" ${USER_NAME}
1110
usermod -aG sudo ${USER_NAME}
1211

13-
/usr/local/bin/gosu ${USER_NAME} /bin/bash -c "${CMD}"
12+
/usr/local/bin/gosu ${USER_NAME} /bin/bash -c "$@"
1413
else
15-
/bin/bash -c "${CMD}"
14+
exec "$@"
1615
fi

0 commit comments

Comments
 (0)