We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8d135f commit 49382c8Copy full SHA for 49382c8
skipper/data/skipper-entrypoint.sh
@@ -28,12 +28,12 @@ if ! [ -z "${SKIPPER_DOCKER_GID}" ];then
28
usermod -G root ${SKIPPER_USERNAME}
29
fi
30
31
- if ! which sudo > /dev/null; then
32
- su -m ${SKIPPER_USERNAME} -c "$@"
33
- else
34
- # for debian dsitros (maybe for others too) -m flag resets the PATH variable
+ if sudo -l -U ${SKIPPER_USERNAME} > /dev/null; then
+ # for debian distros (maybe for others too) -m flag resets the PATH variable
35
# so we need to use sudo -E to preserve the PATH
36
sudo -sE -u ${SKIPPER_USERNAME} "$@"
+ else
+ su -m ${SKIPPER_USERNAME} -c "$@"
37
38
else
39
bash -c "$@"
0 commit comments